pchandler.data_io.e57
E57 file-format handler class.
Classes
Handles E57 file input and output. |
- class pchandler.data_io.e57.E57Handler
Bases:
AbstractIOHandlerHandles E57 file input and output.
Currently limited to reading and writing single scans with and only RGB and intensity scalar field types. All other scalar fields are ignored (due to library limitations).
Supported file extensions:
.e57
Notes
savesupports both a singlePointCloudDataand an iterable of them. Arbitrary scalar fields outsidepye57.e57.SUPPORTED_POINT_FIELDSare skipped with alogger.warningby default. Passstrict=Trueto raiseValueErrorinstead. TheSUPPORTED_SCALAR_FIELDS_MAPlimitation remains in place for all write operations.- SUPPORTED_FIELDS = {'x': 'cartesianX', 'y': 'cartesianY', 'z': 'cartesianZ'}
- SUPPORTED_SCALAR_FIELDS_MAP = {'b': 'colorBlue', 'g': 'colorGreen', 'intensity': 'intensity', 'r': 'colorRed'}
- classmethod load(path, /, retain_rgb=True, retain_intensity=True, pcd_index=None, read_transform=True, ignore_missing_fields=True, **pcd_kw)
Load one or more point cloud from an E57 file.
- Parameters:
path (str or Path)
retain_rgb (bool, default=True) – Flag if RGB values should be loaded (if exists)
retain_intensity (bool, default=True) – Flag if intensity values should be loaded (if exists)
pcd_index (int or None, default=None) – Index of the specific point cloud to load. If None, loads all scans, by default None.
read_transform (bool, default=True) – Indicates if the transformation information should be read, by default True.
ignore_missing_fields (bool, default=True) – If true, no errors are raised if fields are missing from the point cloud.
kwargs (dict)
- Returns:
Returns a single point cloud or a generator of point clouds depending on the value of pcd_index.
- Return type:
PointCloudData or Generator[PointCloudData, None, None]
- Raises:
ValueError – If pcd_index is provided and is out of the range [0, num_scans).
Notes
This is a class method intended for loading E57 point cloud data based on the provided parameters.
- classmethod save(pcd, path, /, *, embed_shift_in_transform=True, strict=False, **config)
Save one or more point clouds to an E57 file.
- Parameters:
pcd (PointCloudData or Iterable[PointCloudData]) – Single point cloud or an iterable of point clouds. Each element is written as a separate scan inside the same E57 file.
path (str or Path) – Output file path. Always opened with
mode="w"(truncate or create).embed_shift_in_transform (bool, default=True) –
When
True(default) and the point cloud carries a numerical-optimisation shift, the shifted XYZ coordinates are written as cartesianX/Y/Z and the shift vector is stored in the per-scan E57 translation pose. On reload withread_transform=True,OptimizedShiftis reconstructed automatically.When
False, the world-frame coordinates (pcd.xyz + shift) are written with an identity pose — useful for consumers that do not honour E57 scan transforms.strict (bool, default=False) – When
True, any scalar field whose name is not inpye57.e57.SUPPORTED_POINT_FIELDSraisesValueErrorlisting all unsupported names. WhenFalse(default), unsupported fields are skipped with alogger.warning.**config (dict) – Additional keyword arguments (reserved for future use).
- Return type:
None