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.3.1.tar.gz
(174.8 kB
view hashes)
Built Distributions
Close
Hashes for pye57-0.3.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 461c6cb298a1b08498ccebd5b357f8228fedf1ef8c4a77ce99acd0ea5e767760 |
|
MD5 | cd1f2313faae04054ec2dc89fe2a8c47 |
|
BLAKE2b-256 | 7054686fee8fae52e6aba69e962be9817b1c13b5185d13a038d89bddaf5c39a7 |
Close
Hashes for pye57-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e72a7a74423ab6b83cd913959d28f1d20577aea9661b7c39988a6c8dfd1764c3 |
|
MD5 | 5dd23ba06f01f4097cfc264ec5ea9468 |
|
BLAKE2b-256 | 5d67c462443d845c5d06bc2aa97c183ee7f314aeb23b5452bad0d39afa20d1e3 |
Close
Hashes for pye57-0.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e25cb31029172102f3700ab28f026b5b73f1f1b4f99d514fa4ad539274d6a669 |
|
MD5 | 53c4a4ae2eaa9fc0192cb663a8bf3e91 |
|
BLAKE2b-256 | 5496df514c588c1bb7537df15639fa30123dc787dd6861db998aab2c4ba8ead9 |
Close
Hashes for pye57-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5e46f939a6ec864ae5d1352fb15a78ca07955a4ab3d261db194cc7a311022d9 |
|
MD5 | 51c91b7a54a09c0f64d09e2935f9a184 |
|
BLAKE2b-256 | 6faa9342a138f0719a641c2476595a249033aca2d4c508ae380775172d0d7048 |
Close
Hashes for pye57-0.3.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb2ae53e14e560896633f17b21cd1999a840c82f0c6b1d99200bcbd2d6193df8 |
|
MD5 | 039a223882bba2d23aadeee83c2cde9f |
|
BLAKE2b-256 | d842bfc2ae45ecdefca7073752e131062d622ab039681e57b6fbda4abff549f5 |
Close
Hashes for pye57-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d7fe6ca035f6f02b9b0e4a499b14cd8a9fe02c7a4ca2af2b19cb305256ce735 |
|
MD5 | 12369c8971c44a7cd4c277cdc7a149ff |
|
BLAKE2b-256 | 9e69d2819c5d85c11c5f331d9948799c59d3fd924dd7d1e8ca996c1d7f554842 |
Close
Hashes for pye57-0.3.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a88e502dc0f37ade5be3f2de0c137162108316be92b7b466f788c1404f846f7 |
|
MD5 | c65cb019716bc925f1bd69696c0408e3 |
|
BLAKE2b-256 | 15ab60e0e1e1c29a40a0d92e7dc94e040ce1186aacf691240226c7e84be6ce3e |
Close
Hashes for pye57-0.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f70865a68940c93f2db8d27b240d9acaeb7e15e558c5d76e8050e2404188caf |
|
MD5 | 23f76c4110de7b42153ce939a93fd9da |
|
BLAKE2b-256 | 9882e4e60726ef84233473e0344b06fe9a9a773422ea37ea33a7ea2e9194bf88 |