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.3.tar.gz
(178.4 kB
view hashes)
Built Distributions
Close
Hashes for pye57-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 687496bb839258d030e2d1c8266106deb7fd68052ab2c1b34312fb5c4aebeef2 |
|
MD5 | 74ec9b34f0a0e6161166959a44ae2a1c |
|
BLAKE2b-256 | 1fcd81d0780b83aa714dbcd095fdece5705429cfbb96168734f74dbb5f5f9427 |
Close
Hashes for pye57-0.4.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 122b91356db08f6d837a6aa55c89d1083a7ba8ce7f77b4e7cbfb122f19cc2111 |
|
MD5 | 3011cc56ba059118903af06499978bdc |
|
BLAKE2b-256 | 26cbbc406ffb676b2a0ce189865e01138de3b6f96421286aa90d89061bb75ecf |
Close
Hashes for pye57-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1e66c386062b54b6470a40ec530b54ba17c877e02992925b2488ab1cf205cf8 |
|
MD5 | 551b88e6f5ad550227e9f878455565b1 |
|
BLAKE2b-256 | 66d5219dfa2474a98ad12a6293a6dd673e5a4a68930d4059fc0b867f60ecdfe4 |
Close
Hashes for pye57-0.4.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b3154efa962adf94562be3612ca182a54fc98965058124bba55e1f9146791c5 |
|
MD5 | c0e02fd7d82e2b6e03293839c4dc9186 |
|
BLAKE2b-256 | a7f19c1ebeec81fc6ac7a8256f3bab12bf49c176c49f42bba33d1a86b54a9cba |
Close
Hashes for pye57-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e35e38399947a6c9367e31b2ef3e3e20598a4235861e701f4f6edc3515f695d |
|
MD5 | 5945c59b8cc82459cc0b90d105e4dcd8 |
|
BLAKE2b-256 | 346af8248e7f10d02caffd7b6e72cd4a43745d870118d544526098b04685819f |
Close
Hashes for pye57-0.4.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a9fe32faf7174d92b4cf6289d62fc8fcde38003fed18f30ec2352649809aa26 |
|
MD5 | 8e63840be694daee4552d3d9b50f97ad |
|
BLAKE2b-256 | 61b10bc578b397c6ba454a476682a195c97258fb0b54f8785a0d5b73d217e84a |
Close
Hashes for pye57-0.4.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b83a90a7251fa086a195ad166057204e7f9b146b16eb11d5a45d72270fb4f15e |
|
MD5 | 408bedfb0c10e2bdf7feb6adb1fcfb45 |
|
BLAKE2b-256 | ff6846d282f0b16a2f0b44fb1cac68682069fe5fcd30771333cbb278abb8a0f5 |
Close
Hashes for pye57-0.4.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7d89301655b79ea84ef26f17ee86e541e6a56e9af571a069fa80901448d0a5 |
|
MD5 | 645e9428f4f815ae993d122fc40ffddf |
|
BLAKE2b-256 | 7955849719e8f0af4f093a6b2fda27284ff8bec29b3ce374ecdaf54d1d19d50a |
Close
Hashes for pye57-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 108b4e100b39fb603a096c42b76dfb60a8fb5af2360681c3f43e95cdd8952690 |
|
MD5 | 7da32337f74c660a8373a074191a8277 |
|
BLAKE2b-256 | 35b0f6e308e85d0f93a27cbad3e5e8f532dc5a5c103e3600a644544f83057da8 |