Python .e57 files reader/writer
Project description
pye57
Python wrapper of LibE57Format to read and write .e57 point cloud files
Example usage
import numpy as np
import pye57
e57 = pye57.E57("e57_file.e57")
# read scan at index 0
data = e57.read_scan(0)
# 'data' is a dictionary with the point types as keys
assert isinstance(data["cartesianX"], np.ndarray)
assert isinstance(data["cartesianY"], np.ndarray)
assert isinstance(data["cartesianZ"], np.ndarray)
# other attributes can be read using:
data = e57.read_scan(0, intensity=True, colors=True, row_column=True)
assert isinstance(data["cartesianX"], np.ndarray)
assert isinstance(data["cartesianY"], np.ndarray)
assert isinstance(data["cartesianZ"], np.ndarray)
assert isinstance(data["intensity"], np.ndarray)
assert isinstance(data["colorRed"], np.ndarray)
assert isinstance(data["colorGreen"], np.ndarray)
assert isinstance(data["colorBlue"], np.ndarray)
assert isinstance(data["rowIndex"], np.ndarray)
assert isinstance(data["columnIndex"], np.ndarray)
# the 'read_scan' method filters points using the 'cartesianInvalidState' field
# if you want to get everything as raw, untransformed data, use:
data_raw = e57.read_scan_raw(0)
# writing is also possible, but only using raw data for now
e57_write = pye57.E57("e57_file_write.e57", mode='w')
e57_write.write_scan_raw(data_raw)
# you can specify a header to copy information from
e57_write.write_scan_raw(data_raw, scan_header=e57.get_header(0))
# the ScanHeader object wraps most of the scan information:
header = e57.get_header(0)
print(header.point_count)
print(header.rotation_matrix)
print(header.translation)
# all the header information can be printed using:
for line in header.pretty_print():
print(line)
# the scan position can be accessed with:
position_scan_0 = e57.scan_position(0)
# the binding is very close to the E57Foundation API
# you can modify the nodes easily from python
imf = e57.image_file
root = imf.root()
data3d = root["data3D"]
scan_0 = data3d[0]
translation_x = scan_0["pose"]["translation"]["x"]
Installation
If you're on Windows and using python 3.5 or 3.6:
pip install pye57
Otherwise, you will have to build it yourself (working on linux and macos versions).
Building notes
You need xerces-c to compile. Binaries can be obtained from conda using: conda install xerces-c
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pye57-0.2.1.tar.gz
(158.9 kB
view details)
Built Distributions
pye57-0.2.1-cp36-cp36m-win_amd64.whl
(330.1 kB
view details)
pye57-0.2.1-cp36-cp36m-win32.whl
(256.5 kB
view details)
pye57-0.2.1-cp35-cp35m-win_amd64.whl
(330.1 kB
view details)
File details
Details for the file pye57-0.2.1.tar.gz
.
File metadata
- Download URL: pye57-0.2.1.tar.gz
- Upload date:
- Size: 158.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb8020c0b0fd5bd4ea305256c3f6cd5641d4577a36394b9695d979dfabb719b7 |
|
MD5 | ac8fc81a20268a7b526e5f19ed1b643c |
|
BLAKE2b-256 | be013392933fdcdf308b65125ce0aa98fed3db99e0c2775aa49f5a9fd29b7f04 |
File details
Details for the file pye57-0.2.1-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: pye57-0.2.1-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 330.1 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44f581089eb41c5846925dc8f58a31ee3656be2e35e99f58afab923bab221877 |
|
MD5 | e8f14a9546b6d5e0087d0c637e28805d |
|
BLAKE2b-256 | 9502a5302af885e0e43248663ea079f5ea5252d175168c6ec0c7e7e6a4961683 |
File details
Details for the file pye57-0.2.1-cp36-cp36m-win32.whl
.
File metadata
- Download URL: pye57-0.2.1-cp36-cp36m-win32.whl
- Upload date:
- Size: 256.5 kB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11564d166ea52bbaf70e1c882770bb535830ae886d31780a9e56f3b131ac9047 |
|
MD5 | dc3124315e620cf163bb94669e77a91b |
|
BLAKE2b-256 | d1ff52ab90b72b558f8c195e7dd52d7c7cbbfd4edb00941b3e8f08fbe6c7135d |
File details
Details for the file pye57-0.2.1-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: pye57-0.2.1-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 330.1 kB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d295f92911764adac663fef074c35978373d46643b55bb0912d1e2f008b83e |
|
MD5 | b495c07c38c60aa64578c3b89aaf4c87 |
|
BLAKE2b-256 | f4fe0eff9bbbcb02d32ffcf3360ad913054a97bf35ea2834ea802cd00941fc86 |