Skip to main content

Python .e57 files reader/writer

Project description

pye57

PyPI PyPI - Python Version AppVeyor

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pye57-0.1.6-cp36-cp36m-win_amd64.whl (339.9 kB view details)

Uploaded CPython 3.6m Windows x86-64

pye57-0.1.6-cp36-cp36m-win32.whl (266.3 kB view details)

Uploaded CPython 3.6m Windows x86

pye57-0.1.6-cp35-cp35m-win_amd64.whl (339.8 kB view details)

Uploaded CPython 3.5m Windows x86-64

pye57-0.1.6-cp35-cp35m-win32.whl (266.3 kB view details)

Uploaded CPython 3.5m Windows x86

File details

Details for the file pye57-0.1.6-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for pye57-0.1.6-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2dc7c1a0cf1c0672739f7ff304fb026e96823d429f0f581b9d7a1b2d1697753e
MD5 bbd49fb10bd1354f86ad5085a05c950f
BLAKE2b-256 e035a0bf7957fbc23c283e9127332183778ad63b5ccb63c6f214c008c1c88458

See more details on using hashes here.

File details

Details for the file pye57-0.1.6-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for pye57-0.1.6-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 5526388b6b1a7ac1969f5ba77a4ab2beb81898748fe988e028eea35ea1533afa
MD5 7940b7e827928cfd4e5686f479b02c3b
BLAKE2b-256 50a23ebaedb32bde97d32ca13c248ae84c82b7f9428bd83a240c63fbcae12ab2

See more details on using hashes here.

File details

Details for the file pye57-0.1.6-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for pye57-0.1.6-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 2487d4137257eb469a317a11c2e0da3a84c374a0270402f5e575d6c66bddf2b6
MD5 bb6ae6f965ffbe84f9c3519abc2b1b89
BLAKE2b-256 ef29b909e0754f11f1ee2482eaa36fe4338d25ca122fc5fe2b52bbf81de11d3e

See more details on using hashes here.

File details

Details for the file pye57-0.1.6-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for pye57-0.1.6-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 353fba1d67945cc016986dc2ae66509bd1d2321ce902e35fd1ffda9b27f2a1d9
MD5 a115098f68d7769e0be46263ab11ad1b
BLAKE2b-256 0bc67d2945fee7e39d8aedde372e336bc7505cfd4fb63bb399d36416ff4f68dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page