Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Karl-Keller/e57Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

E57 File Type Analyzer

A Python utility to analyze E57 point cloud files and determine whether they are structured, unified, or unstructured.

Installation

pip install pye57

Usage

Command Line

# Basic analysis with formatted output
python e57_analyzer.py scan_project.e57

# JSON output
python e57_analyzer.py scan_project.e57 --json

# Full JSON with per-scan details
python e57_analyzer.py scan_project.e57 --json --full

As a Module

from e57_analyzer import analyze_e57, print_analysis

# Analyze a file
analysis = analyze_e57("path/to/file.e57")

# Check classification
if analysis.is_structured:
    print("File is structured - can extract per-scan data")
elif analysis.is_unified:
    print("File is unified - single merged point cloud")

# Access details
print(f"Total points: {analysis.total_points:,}")
print(f"Scan count: {analysis.scan_count}")
print(f"Confidence: {analysis.confidence}")

# Pretty print full analysis
print_analysis(analysis)

Classification Logic

┌─────────────────────────────────────────────────────────────────┐
│                        E57 File                                 │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
                    ┌─────────────────┐
                    │  Scan Count?    │
                    └─────────────────┘
                      │           │
                 Single         Multiple
                      │           │
                      ▼           ▼
            ┌──────────────┐  ┌──────────────────┐
            │ Has Row/Col  │  │ All scans have   │
            │ Indices?     │  │ Row/Col indices? │
            └──────────────┘  └──────────────────┘
               │      │         │          │
              Yes    No        Yes         No
               │      │         │          │
               ▼      ▼         ▼          ▼
          ┌────────┐ ┌────────┐ ┌────────┐ ┌──────────┐
          │STRUCT- │ │UNIFIED │ │STRUCT- │ │PARTIALLY │
          │URED    │ │        │ │URED    │ │STRUCTURED│
          └────────┘ └────────┘ └────────┘ └──────────┘

Key Indicators

Indicator Structured Unified Unstructured
Multiple Data3D elements
Row/Column indices
Index bounds
Registration transforms Maybe
Embedded images
Scan positions recoverable

Output Structure

@dataclass
class E57Analysis:
    filepath: str           # Absolute path to file
    file_size_mb: float     # File size in MB
    scan_count: int         # Number of Data3D elements
    total_points: int       # Total points across all scans
    is_structured: bool     # True if structured
    is_unified: bool        # True if unified
    classification: str     # "structured", "unified", "unstructured"
    confidence: str         # "high", "medium", "low"
    reasons: list           # Human-readable explanation
    scans: list             # Per-scan details
    coordinate_system: str  # "cartesian", "spherical", "mixed"
    has_images: bool        # Contains 2D imagery
    has_transforms: bool    # Has registration transforms

Example Output

============================================================
E57 FILE ANALYSIS
============================================================

File: building_scan.e57
Size: 2847.32 MB
Total Points: 1,247,832,456
Scan Count: 42

----------------------------------------
Classification: STRUCTURED
Confidence: high

Indicators:
  • 42 separate scans preserved
  • All scans have row/column grid indices
  • Registration transforms present
  • Contains 2D imagery

----------------------------------------
Technical Details:
  Coordinate System: spherical
  Has Transforms: True
  Has Images: True

============================================================

Integration with RoboFlat

For the RoboFlat pipeline, use this to validate incoming E57 files:

from e57_analyzer import analyze_e57

def validate_e57_input(filepath: str) -> bool:
    """Ensure E57 is suitable for variance analysis."""
    analysis = analyze_e57(filepath)
    
    if analysis.is_unified:
        logger.warning(f"Unified E57 detected - per-scan variance not available")
        return False
    
    if not analysis.has_transforms:
        logger.warning(f"No transforms - scans may not be registered")
        
    logger.info(f"Structured E57 with {analysis.scan_count} scans")
    return True

Dependencies

  • Python 3.8+
  • pye57 (wraps libE57)

License

MIT

About

Variety of utilities for dealing with .e57 files of different types.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages