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.1.tar.gz
(175.6 kB
view hashes)
Built Distributions
Close
Hashes for pye57-0.4.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae7518de3037ddeaa092f9bc67b52ddf0ff5b68a5f7f21f2f882368315038590 |
|
MD5 | 516e7e1929f54bf79a4be0a9fd13a02c |
|
BLAKE2b-256 | 3f977d101376c8c0515042bf36212c5418d0f012188eaf51c9eccdf17de61765 |
Close
Hashes for pye57-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c00cb92c1054c84dfe82e0a99f29afd2efc65d5ba0d374c1a6d4e666d4bc5ac |
|
MD5 | 39c5ba033c216c45982b0119b97499ee |
|
BLAKE2b-256 | 501acfa2f50cec1cb7410034bd377f784baaebae3a823aa03f528f06e9f10a0a |
Close
Hashes for pye57-0.4.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7b72f8ee2349840fd12697947ebd066c525c8a2461f3e120becd511bd6b03b1 |
|
MD5 | fd7027d6a65e0fc184aec4c081b4d5f6 |
|
BLAKE2b-256 | 7db570b73515bdbd670cce61d35370d91b39f97c14e91e9c4a11eca3dcdb7ac2 |
Close
Hashes for pye57-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2102e527b106acc493572d3fe77f365d9cf2aad8389e2a5504f2274e6eeef0bf |
|
MD5 | 9e7df2f562abcfaf7cd8a0b51a9c3d62 |
|
BLAKE2b-256 | 20479e6c78714b5c122004edf53323cd69eacda1a07e5bc03df7edf025ee1f21 |
Close
Hashes for pye57-0.4.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4462fd1356c87c70a17df9904610bf55b508861fedeac0bba12c6f20157b713 |
|
MD5 | 127fca0fd346b458e2435604b0258468 |
|
BLAKE2b-256 | 043538d2f5ff7ce41e19b06d64bb320fcf3a6398dbf892d4e3d723bfe7c9260b |
Close
Hashes for pye57-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 022bcbb7c77636c5e1e32c6e2fb0e9cc935357c5d03d5a123fceb413f7c0a97a |
|
MD5 | 1b2bb6e6431b4e3155077b62067f9874 |
|
BLAKE2b-256 | b24b8f85fe0549099a2a2b7a9ecd07fd8324e0cf68ca811a909f67a7f2b91f33 |
Close
Hashes for pye57-0.4.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 292aea646b0729bf7e4eacd781dbe4ec4d3d325552174753d1ed1d52a27b6946 |
|
MD5 | 3ca34ee77ab05cb7a92d2275bf507296 |
|
BLAKE2b-256 | 19b89522d2f474efc41d004a977bf31d9030337368236c9e872777177f894186 |
Close
Hashes for pye57-0.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a80db228229dfbee0462381b017a1fdc142e1beaeda8869455db128056fa39c |
|
MD5 | 0d5164fa6d28ae79b3475512c0b61f07 |
|
BLAKE2b-256 | 89e70ff0adc5abd75b6f8a804ad156d700d36ea2b8e1076ecf43cf7c3519b063 |