Neuroglancer compressed_segmentation codec.
Project description
NOTE: This repository is the PyPI distribution repo but is based on work done by Jeremy Maitin-Shepard (Google), Stephen Plaza (Janelia Research Campus), and William Silversmith (Princeton) here: https://github.com/janelia-flyem/compressedseg
Compress Seg
Library for compressing and decompressing image segmentation (adapted from neuroglancer)
This library contains routined to decompress and compress segmentation and to manipulate compressed segmentation data defined by the neuroglancer project. compressed_segmentation essentially renumbers large bit width labels to smaller ones in chunks. This provides for large reductions in memory usage and higher compression.
Note that limitations in the compressed_segmentation format restrict the size of the chunk that can be compressed. As this limitation is data dependent, for example a random array with 1024 labels passes testing at 256x256x128, but 256x256x256 often does not.
Features
- Compression and decompression
- (TBD) Interface to relabel and manipulate segmentation from the compressed data
- C++, Python, and Go interface (see original repo for Golang)
C++ Compilation
Compiling as a shared library. Feel free to subsititute e.g. clang for the C++ compiler.
g++ -std=c++11 -O3 -fPIC -shared -I./include src/compress_segmentation.cc src/decompress_segmentation.cc -o compress_segmentation.so
Python Installation
pip
Binary Installation
$ pip install compressed-segmentation
$ python
>>> import compressed_segmentation as cseg
>>> help(cseg)
If there are pre-built binaries available for your architecture this should just work.
pip
Source Installation
If you need to build from source, you will need to have a C++ compiler installed:
$ sudo apt-get install g++ python3-dev
$ pip install numpy
$ pip install compressed-segmentation
$ python
>>> import compressed_segmentation as cseg
>>> help(cseg)
Direct Installation
Requires a C++ compiler such as g++ or clang.
Works with both Python 2 and 3. Encodes from / decodes to 3D or 4D numpy ndarrays.
$ sudo apt-get install g++ python3-dev
$ pip install -r requirements.txt
$ python setup.py install
$ python
>>> import compressed_segmentation as cseg
>>> help(cseg)
License
Please see the licenses in this repo.
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
Built Distributions
Hashes for compressed_segmentation-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b98977c71d855ad686682d587f4304792935b9ac66f3ef17b61f12db83f880fb |
|
MD5 | f7805376399e98d3f7d7debc33ba32ff |
|
BLAKE2b-256 | 00cea3a7bec775564b12b283b996e9a9ba350c84a2438212c28228e04a471f7d |
Hashes for compressed_segmentation-2.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29a1f4d1c959cbde7ed51c7162852a078fb5ad1e4c2867e26fbc57b567f846da |
|
MD5 | fe3e14defaf0dd0475171ff7b267b07d |
|
BLAKE2b-256 | 616a58cffc458a07dc682db6c91368fb38b7217af90a9f23ffdb1fe2df5760b6 |
Hashes for compressed_segmentation-2.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd294fb51629d4500fd84e2109716d90cfbce284763aade48f95600b9cb3f58b |
|
MD5 | 9edf8834fd416d6427e3d35fd1487bdf |
|
BLAKE2b-256 | 3f3bbe5b489f60d522c4d8217d4faf5cef5726873deb56ca376661836e77f2b0 |
Hashes for compressed_segmentation-2.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c0659e97e06cd9f043bad694d2d5a6437d6d5967db230c0c902b5d508a5a506 |
|
MD5 | ba99e82f0560b9446c52dc835ae5c83d |
|
BLAKE2b-256 | d2e7033a8a4970c2707fc45886ce90e5ef85126e1ce6914879d09200fae0193c |
Hashes for compressed_segmentation-2.0.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017077b28baa197099bb56114479709afee6430b03eefc37676e535d075fdf73 |
|
MD5 | 00f83b8568bceee14df9b9efc3a705df |
|
BLAKE2b-256 | 3addd3ac517b444ae7f0668eaee2f8b0deb9b6dbec2c3a501081af4441ec9fe7 |
Hashes for compressed_segmentation-2.0.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 330c1a1ed2d2eb9fdf1d9b9f9e0c0b71153028ff72cbae07e87178dc05e16a43 |
|
MD5 | a119ef85ec3b6b0023aac189174473a9 |
|
BLAKE2b-256 | 483a8e707fb79ac04e00fdf89541c6cd0e28326c9ebf8843b29e6b64ba03d876 |
Hashes for compressed_segmentation-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 667877675aee5c20aadbf82d3925fcba6c367d68a73fe7e0807097434d12588a |
|
MD5 | 971318fbb1e53d69b90648b7650b1dca |
|
BLAKE2b-256 | a9673a75b0eee9a4568e01dd0426b1fdb2479297f88f9155c4a07d3b49f3923f |
Hashes for compressed_segmentation-2.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b1621d0013a8526393ba966f04952114b48b1d5959e8aa20ae96c57e7289864 |
|
MD5 | d380ce80b0754cfc626ac20108b67a82 |
|
BLAKE2b-256 | f1407d926f5ad7b997be522a77b5505f7edd9c7663a085d6c99ae5d0083cd1e2 |
Hashes for compressed_segmentation-2.0.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c1c7abc0273c4a37c953f62654fd2638b678d94099e819090bba4dfb420d26d |
|
MD5 | f960f3dbdc0e26a84a319fe5edac8b60 |
|
BLAKE2b-256 | 3d727393cd2e861c57de89ba7ad5524e977ef9d3402014201cfb01ead4c355ce |
Hashes for compressed_segmentation-2.0.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8da66b7a1d0ac9cf8b3c42fec0206f914e7472f6ff4f9ba92d2897b6ec1e1dbc |
|
MD5 | 574e3e691fe9f1c14c45337fda54d911 |
|
BLAKE2b-256 | 0d21e86863c7834f18f751ff59a2dbe3e3ba7148cb1b4c4950bd69b7bce51d4b |
Hashes for compressed_segmentation-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859ac0f2bf04467ad29a11fc1d761eb889a0bb45a9938aec74140b2fbf703fdb |
|
MD5 | 0d3090a98e62773357a9d68171b0f6b8 |
|
BLAKE2b-256 | 636da7ba4eb479d5b53afab1987d4d8bdce2225f6fd08547c348acfaa842545f |
Hashes for compressed_segmentation-2.0.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e7ab6136fc1ca741a84986feaa99d9c0f16041e9a35c610904adfd68fa0292 |
|
MD5 | 8c7f9a42ba9d8a539f62e7e632b1d31a |
|
BLAKE2b-256 | 42e8637ed215d72fb55c2355b38b81628155d2e1a390e2b60d3624093961127f |
Hashes for compressed_segmentation-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76f874b4d9094c5ff031e7d8d866b0628bfd141ea666724a3e44434aa6fb0cac |
|
MD5 | 13395d7022f07260428f2690cad05fb6 |
|
BLAKE2b-256 | 78a7b6c05e80ad57a4741a8af3f8bf6a01cfaec0df31d42105ca987600bbd46b |
Hashes for compressed_segmentation-2.0.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 026ce7d425893715ffc1f3bd56eef152864f56b786b7f35458a84aafc7b53e25 |
|
MD5 | 4977b953c56cd44532ffbe4e5704a881 |
|
BLAKE2b-256 | ccd9332da2a2cdc9af35fda07fb3a6dcbee601402044c148a0064addc72cdc1d |
Hashes for compressed_segmentation-2.0.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1019c889ea6d2010ba5bf30fed90caba758d7f0e542591527764e7885f88cd |
|
MD5 | 727f3dfd94a435d51a3a1a6c2e15039a |
|
BLAKE2b-256 | 2e54be2494b6f45647101c44705ecda281b64d64157e1978fb33518e62776189 |
Hashes for compressed_segmentation-2.0.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c39e23d3c3e217648b7af9f44c3ea3d39eee794c0327415c96b228299b9d93d3 |
|
MD5 | 0e34e7c00af28e83411bad417c5d7720 |
|
BLAKE2b-256 | 6b1f2efe19d5e0baece42cf53888fa63b1fbc69bc45e32de295ce488aab56810 |
Hashes for compressed_segmentation-2.0.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a9bbcf12db34888cd47754644eacedc98de3dea6ff6c787eb445f3d955e8648 |
|
MD5 | 9f09e5b2bf559b45576c29205e60a091 |
|
BLAKE2b-256 | 15a21b7d39969b1bb43db73b522a7b6725b5e21f63fb107e48f213a63cd14cdc |
Hashes for compressed_segmentation-2.0.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3163bf26c39dceecf417af27f37ecbde29da69feab8495f135489a898b66c2c2 |
|
MD5 | 11fde44507209039ef541ccc2620c6fd |
|
BLAKE2b-256 | c7f766e99b62baefdae84f2d3fbc5500cefdf94d841a94831bd3d49d75974042 |
Hashes for compressed_segmentation-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a70bcebf9cd7ffea86c83d5696e3cb454f08358eac4aec266dfcfad61e1f968 |
|
MD5 | f3fc4f164acf730952071258da2b076a |
|
BLAKE2b-256 | 660a4bb0b5723deb7918a3b9a1c3cdc1f5dbc7cd0fd9ecfb8ea2f20fc20ce4cd |
Hashes for compressed_segmentation-2.0.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97881be48a8419d05fead67c26e781a6137ecec5e7f986ce194ca82d9b8ab997 |
|
MD5 | 72de15a5657079e01162ba451f1bc3c9 |
|
BLAKE2b-256 | 45c76c092eaeb96a952c6432fb8e0e009ea5ed0f7c8085077abb0ade605fcafc |
Hashes for compressed_segmentation-2.0.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480018ac2fb84c1f654d239ed44e5be3ca1580f78e1e27e944d6e7603d2a69a0 |
|
MD5 | 4ceb653958baa238c08850a2c007746a |
|
BLAKE2b-256 | a7175e7b1e861d1f7209b575bd6f2659c411bde7c8bb57e2ede3d3909b36f54e |
Hashes for compressed_segmentation-2.0.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3d0c6b8c0fe7e7c9c52638ecc43fc9295f212e80d6eae935e3a4a63f6dbc78 |
|
MD5 | ce8b2247f07c28a87af1687ad72d9e63 |
|
BLAKE2b-256 | d24558f511b25618fda6ea8bfe4280315cdcb5c48c3736be0ab068c4387d6d2a |
Hashes for compressed_segmentation-2.0.0-cp27-cp27m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f05da9ab8ec30eb7684d78dcaa585849ce5d59feed1b24dba4870ba6991abfa4 |
|
MD5 | 6ce21642f770658e9757abc8f3e8aaa2 |
|
BLAKE2b-256 | a45dc7cfd2ad57641dafb7ece59e0573d352c755fd88b33ae7a30a13ba89c62f |