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 linux or Windows, a wheel should be available.
python -m pip install pye57
Building from source
Cloning the repository and required submodules
Clone a new repository along with the required submodules
git clone https://github.com/davidcaron/pye57.git --recursive
If the repository has already been previously cloned, but without the --recursive flag
cd pye57 # go to the cloned repository
git submodule init # this will initialise the submodules in the repository
git submodule update # this will update the submodules in the repository
Dependencies on Linux
Install libxerces-c-dev first.
sudo apt install libxerces-c-dev
Dependencies on Windows
To get xerces-c, you can either build from source or if you're using conda:
conda install -y xerces-c
Run pip install
from the repo source
cd pye57
python -m pip install .
Uninstalling
Use pip again
python -m pip uninstall pye57
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.4.2.tar.gz
(178.4 kB
view hashes)
Built Distributions
Close
Hashes for pye57-0.4.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf4abc9fb2dc4a7de83b197972e67c08d05e296286a71122ae1cff8631f0c28a |
|
MD5 | 7f07be62c3cbffdedf05bfcc99a0299a |
|
BLAKE2b-256 | bba88c823f75d0146e8725d96b1118e049e2b8ee21b7f67f25d16897c3e1b379 |
Close
Hashes for pye57-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a346f5b4c86813b06f075acf06fe1a5fe03db81798f2dddbad1ca57432196b00 |
|
MD5 | e7c062490dabe6817341bb7695f77639 |
|
BLAKE2b-256 | 1de17dc8e31a720d3369bdb450e0cb9fe4333d32916a749ce67f757544633d2a |
Close
Hashes for pye57-0.4.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c980265018bd31719e62270c12cad1ba76808671149ba7c746c6aaa315cb49b |
|
MD5 | 1b1c79688e8be0a8cdba9a3a4358992e |
|
BLAKE2b-256 | fe742ebfb6434181119acbf1c8fa769d4218c137600f7569ed36cee2f404f5ef |
Close
Hashes for pye57-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48efebb29d64e696aa1a5888e5288f565327479711cf8ba84df75c96666c19ef |
|
MD5 | a5adc5de1bf430bf61ae5155e5d7007c |
|
BLAKE2b-256 | 01451ec1af460118fc8527812173aee7c1cdb233f182face514dfbdb755624ee |
Close
Hashes for pye57-0.4.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb936910ab68e7c53c61569cd2fff5434fb4286b719c23b5422606a526164ec |
|
MD5 | 76d8ab77548fa5a25c89cf4f8d968932 |
|
BLAKE2b-256 | b4744579753d78cf0843cd7ee14422efb27b6dd6059e97fddb658e107266b461 |
Close
Hashes for pye57-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cae02b7851378efbcaf270ee3798cd429f10a965b7823ce527dd44dda6cf76ad |
|
MD5 | 258ffb7c156a7d7d7ae009f294b3d315 |
|
BLAKE2b-256 | 1d179df3a5a05b680c2cb6b3dc9e4781ca46a73ee8d2cb8e152a269c15c6acff |