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.4.tar.gz
(471.0 kB
view hashes)
Built Distributions
Close
Hashes for pye57-0.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79d44dce02d681380f4ca57f9269d6b46595a04340b53778dcf90fcb4e705ca7 |
|
MD5 | 75e7cd12f4e233de584db1ea86938500 |
|
BLAKE2b-256 | 788105debbec9577fb4fe3282fc182720bca1b2fe59ba69a97b502a034975436 |
Close
Hashes for pye57-0.4.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51dcaab35ebf73cbafff6e887f87fc99f5ab720a7c0dd32f1ddabb4a5724ec7f |
|
MD5 | 0a30465d485123c61f58344722462ac0 |
|
BLAKE2b-256 | 5da12dde24bd917c156d91a0f18334609741345aab378b3f809381a37573b725 |
Close
Hashes for pye57-0.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b612e40bbf75b84ca69e5e05a3d801834d9738b354aef739f80af9426f7b0643 |
|
MD5 | f020a3f199141a58a661c08304a6dd73 |
|
BLAKE2b-256 | f4990e8620258153af10d22eab6d7df7c4d1a80e052cb76d5784358a27f5ebcf |
Close
Hashes for pye57-0.4.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81c6d6898e5522685fef73a863962545983ce7bbe2e2f380a0f816aaa0f73279 |
|
MD5 | a9428edb7c1cda712d64090583651a42 |
|
BLAKE2b-256 | 2964f51b91fe22e1d8d20d077edc4ef855b7571f09f195948411892f5df676bf |
Close
Hashes for pye57-0.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d27cd564604985b3ea3dc7f9db01535c42a7552bbb7ad6b83dade856fb3b75ff |
|
MD5 | 890f40be031b379eb76dc8765d32467c |
|
BLAKE2b-256 | 32137e4e95aaf0513e64e7b156a3e942f693b9375baab7207aa6a530b7e929a2 |
Close
Hashes for pye57-0.4.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61624f71cd0396f8481c7a08facfbfd9f161bcbd480a3d18f7c62642322a72f6 |
|
MD5 | 5ed62a66f966413b7cc9e647044f5d84 |
|
BLAKE2b-256 | 12be6ff95c983581aba8941493dc48a337e042082e0d78550476f504440d9566 |
Close
Hashes for pye57-0.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d70aa4e5bac52c2eb94cd74a8cbf04d47a3e0fa7fa28724f616b1276119a239 |
|
MD5 | 8487028071354bed7fdb178364a4519f |
|
BLAKE2b-256 | dc1d1c89b403ad062108a5ab2a9f465d2cc12a987de5913609ca0f181db62a66 |
Close
Hashes for pye57-0.4.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a8ca7b806f9cd7e109c0bc69ab30c88577aedd671892b55c1dce40ecf6d494f |
|
MD5 | 3525f61e54475fbaa15e058075558179 |
|
BLAKE2b-256 | 8bb23a5892990396570bc3dec41937f7d5d4df101d91fed75f5a15a52c4294c4 |
Close
Hashes for pye57-0.4.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff2d0328bb11044b563164c464cae8d1c659b976bfab4adfcb6d96477d72245b |
|
MD5 | 776e12348fa36b9a47547ab161ab3246 |
|
BLAKE2b-256 | a7cadf05bc3150aa23a32244c264a72e2d9d6ec453d0fc00614362cd51457e3a |