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
On linux Windows or macos:
python -m pip install pye57
Building from source (for developers)
Cloning the repository with required submodule
Clone a new repository along with the libe57Format submodule
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.6.tar.gz
(472.7 kB
view hashes)
Built Distributions
Close
Hashes for pye57-0.4.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88fe4e1f7b9432d4cf12b7f678cdc93be4951acaa906157d85dc70a4869757a7 |
|
MD5 | b272d52d1644b4d57dfccb1394544472 |
|
BLAKE2b-256 | 768ce50ef2eedda83089b5f97f490dacc46709ed2221d7438ca2f4734a25562c |
Close
Hashes for pye57-0.4.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b76aad736295b5c87bfa681e039d99c974db802bad4e92576fdd86719513aa7f |
|
MD5 | e9cc8c40ec311f521502a34adf575c1f |
|
BLAKE2b-256 | 5fb4e91f73108b6e6a540ce732c85d38fdb464a0d1f6a8e7bd55a35908065f2d |
Close
Hashes for pye57-0.4.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d225a970edc84836039d8006c8fd8d162686c4a24b9cdc47c51ec0b94f824aa3 |
|
MD5 | a2c7e3b050049e45c0f7440868ec4ad2 |
|
BLAKE2b-256 | 8fc6eaa443011ac79c0540df890d7afbb314de26306d96d1c7d87554a5a4fb06 |
Close
Hashes for pye57-0.4.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0e7399256fd47c9e7efec61209cbc86dbb9202b4fdebcdddad85e2bb9c861fa |
|
MD5 | 715c6d401d2c3bf75fa2ad3fba36c9e1 |
|
BLAKE2b-256 | 6e92ade4fee7744784c1b85cb3a9a62b7605cd8833b8e3b5297420180bff3dad |
Close
Hashes for pye57-0.4.6-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882bef1a02410a52df0285f7f6e7f559b541a49ccadb56a3414ac6578af84c6f |
|
MD5 | e58050a9228cac18474ccf2a86322205 |
|
BLAKE2b-256 | 49375ae839f83248423ae40ab33f4fcb5ef5724d6eb165ccdaf115e2496f4fa8 |