Skip to main content

Unofficial packaging of the compresso algorithm based on work by Matejek et al.

Project description

Compresso: Efficient Compression of Segmentation Data For Connectomics

*NOTE: This is an unofficial packaging of the work by Matejek et al. which can be found here: https://github.com/VCG/compresso *

Paper MICCAI doi

Segmentations

Recent advances in segmentation methods for connectomics and biomedical imaging produce very large datasets with labels that assign object classes to image pixels. The resulting label volumes are bigger than the raw image data and need compression for efficient storage and transfer. General-purpose compression methods are less effective because the label data consists of large low-frequency regions with structured boundaries unlike natural image data. We present Compresso, a new compression scheme for label data that outperforms existing approaches by using a sliding window to exploit redundancy across border regions in 2D and 3D. We compare our method to existing compression schemes and provide a detailed evaluation on eleven biomedical and image segmentation datasets. Our method provides a factor of 600-2200x compression for label volumes, with running times suitable for practice.

Paper: Matejek et al., "Compresso: Efficient Compression of Segmentation Data For Connectomics", Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2017, 10-14. [CITE | PDF]

Requirements

  • Python 3.5+
  • conda

Setup

git clone https://github.com/vcg/compresso && cd compresso
conda create -n compresso_env --file requirements.txt -c chen -c sunpy -c conda-forge -c auto -c indygreg
source activate compresso_env
# for Compresso scheme as presented in MICCAI
cd experiments/compression/compresso; python setup.py build_ext --inplace
# to run the neuroglancer compression scheme
cd ../neuroglancer; python setup.py build_ext --inplace
# for Compresso v2 that is under development
cd ../../../src/python; python setup.py build_ext --inplace

Compress Segmentation Stacks

There are two versions of Compresso in this repository. Under the src folder there is an updated c++ and python version that extends on the Compresso scheme presented in MICCAI. This algorithm, among other things, implements bit-packing to further improve compression results.

The compression scheme in experiments/compression/compresso follows the MICCAI paper exactly.

Compress Your Segmentation Stack

In order to test Compresso on your own data simply use:

import compression as C
# With LZMA
C.LZMA.compress(C.COMPRESSO.compress(<NUMPY-3D-ARRAY>))

Experiments

# the dataset must be in hdf5 format.
experiments/run.py COMPRESSO LZMA ac3 -r 1 -s 1 -d '/<PATH>/<TO>/<DATA>'

Usage:

usage: run.py [-h] [--directory PATH] [--runs NUM] [--slices NUM]
              [--verbose]
              encoding compression dataset

positional arguments:
  encoding              name of encoding scheme
  compression           name of compression scheme
  dataset               name of data set

optional arguments:
  -h, --help            show this help message and exit
  --directory PATH, -d PATH
                        path to data directory
  --runs NUM, -r NUM    number of runs (default: 1)
  --slices NUM, -s NUM  number of slices per dataset (default: -1 (all))
  --verbose, -v         print progress (default: False) 

Make sure the data sets are located in ~/compresso/data/ or specify the location. The data from the paper can be found here:

Results From the Paper

Compression Performance

Compression Performance of Connectomics Datasets

Compression ratios of general-purpose compression methods combined with Compresso and Neuroglancer. Compresso paired with LZMA yields the best compression ratios for all connectomics datasets (left) and in average (four out of five) for the others (right).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compresso-1.0.0.tar.gz (212.3 kB view details)

Uploaded Source

Built Distributions

compresso-1.0.0-cp38-cp38-manylinux2014_x86_64.whl (704.6 kB view details)

Uploaded CPython 3.8

compresso-1.0.0-cp38-cp38-manylinux1_x86_64.whl (511.9 kB view details)

Uploaded CPython 3.8

compresso-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl (112.0 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

compresso-1.0.0-cp37-cp37m-manylinux2014_x86_64.whl (609.7 kB view details)

Uploaded CPython 3.7m

compresso-1.0.0-cp37-cp37m-manylinux1_x86_64.whl (489.6 kB view details)

Uploaded CPython 3.7m

compresso-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl (110.0 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

compresso-1.0.0-cp36-cp36m-manylinux2014_x86_64.whl (607.0 kB view details)

Uploaded CPython 3.6m

compresso-1.0.0-cp36-cp36m-manylinux1_x86_64.whl (491.6 kB view details)

Uploaded CPython 3.6m

compresso-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl (113.1 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

compresso-1.0.0-cp35-cp35m-manylinux2014_x86_64.whl (599.9 kB view details)

Uploaded CPython 3.5m

compresso-1.0.0-cp35-cp35m-manylinux1_x86_64.whl (482.7 kB view details)

Uploaded CPython 3.5m

compresso-1.0.0-cp27-cp27m-manylinux1_x86_64.whl (475.0 kB view details)

Uploaded CPython 2.7m

File details

Details for the file compresso-1.0.0.tar.gz.

File metadata

  • Download URL: compresso-1.0.0.tar.gz
  • Upload date:
  • Size: 212.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for compresso-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f4d4e8744771316b85237cbe35efe84e170247e154cf66036d9c8bd9b5512f71
MD5 7ae9f1d9a6bf25569e022fa9e27ae888
BLAKE2b-256 9ed1622a92167bf2395961bbe1b4bac61e86c57bcd2c56a6053a4b74b87e7242

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 704.6 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for compresso-1.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 320f7a9fe3028fd99d286382a5179ee1c308c795f079d19db50591324b63d0e6
MD5 c448aeb0a0bf6e9ec93187a0800ac89c
BLAKE2b-256 8b3f4a96b621b1ede0561273cad8dae578fb4d7fac6980279f270217d2d0f256

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 511.9 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for compresso-1.0.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ac4d7e8811cb8dbe5c0cbc291c35f41ee4a083dfba68d4e48730ec4b8b8b305e
MD5 185390c68d88bc7d78dad8f96621d159
BLAKE2b-256 e2fad4be7c9bc4f66160e127d61224ec8c673b8fbacd9f7dbc344997141ed302

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 112.0 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for compresso-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 00f42be4adf62a97290a76690994820b2ffa7777ba83a5094383668df9e51103
MD5 d42d6bef6cfcb750b51efb9d5f76dd4b
BLAKE2b-256 d86a2967faff2279fe6bda71efebada2ca5fdd6374d933fe9d16dd634fbb323d

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 609.7 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for compresso-1.0.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53cd4840a426c33a4d3878e312ea4c26f3a2dac8f33b178973d639c411c3400c
MD5 5d4ca708a4733c87c32155389f1de339
BLAKE2b-256 97858bf024d334003fb00cedc5950488d7081dbcddeffdc26ecdca3aca6cef17

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 489.6 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for compresso-1.0.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a0320eba6df2a142b63107cca7fbe93b70a7bde271a744ac3e70b2a9d82a9ce6
MD5 007f84634fc6823e2eb068d211694dab
BLAKE2b-256 2c4e615d9d803d195e67437de1564f1d8ef638f9995e755bb3fa4b3340919eb5

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 110.0 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for compresso-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0097aceee3eb340133bbf20859bafbf3f3efb7301630f5949b4bd6dfee48e050
MD5 c30060b7e584175fc0e74ee7e028c7f3
BLAKE2b-256 5c66ed6eb93cf70e1897282e8dc926875f761ac88649704cb1381373b5b961c8

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 607.0 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for compresso-1.0.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1130c0a2fc8618289caaac0a9d4b2eb5ed84d84aaa1eb74e4e587ae19a35f164
MD5 f92d1471f1b2aaa74b6297867c4c595d
BLAKE2b-256 c40a4f2e84b51e225b379a2a1b71219c0873819cb25b28792cd00640ad0183c0

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 491.6 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for compresso-1.0.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7e727a3fb82ff295bd48c4d8bebe4983aae7db624504fe00c3c35bc790fd2b92
MD5 0554b21ff164ec0acf11df1a7bbda05e
BLAKE2b-256 5f7e8c8f55e9a963f9059df08b08eebf6969bcf54fe018194b287047e56bf658

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 113.1 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for compresso-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 52c75257eb353ec497f6827f4c3faf528a2186a41998121ea831f730ab3e5147
MD5 1e261d4331283180f33487dd3e623e0c
BLAKE2b-256 efb06008f252716e14d1d835beffe652bdf50dc22f9bbbd45bda4708c0a0285a

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp35-cp35m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp35-cp35m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 599.9 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for compresso-1.0.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73288b8e0d52c9f28298663feb2e95f9005188f1876aa27081033b10a11b51de
MD5 4c07ebcb27ec81d038f702444fd4d4d0
BLAKE2b-256 fc21b1fac6fe3585b3c2ca6217c461a309e09449ab6520cc27b42706d7f236e5

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 482.7 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for compresso-1.0.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 152410f66736fc82f30864f9f1adf8afb3d7503c7ea4459fe7527dab23d7636b
MD5 02caed40654c14481d96c3ffe6ac93a8
BLAKE2b-256 b141c37fc25749efc73f4e49d6e2466b2d4070425501e55a9fa0813461cc491d

See more details on using hashes here.

File details

Details for the file compresso-1.0.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: compresso-1.0.0-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 475.0 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

File hashes

Hashes for compresso-1.0.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 eca2b49559fb51bebff4f972c56a30f33ebf35c55b15ce1156d77fba60c8f36e
MD5 ccbf15611b8907e6a39fc0a77a965dce
BLAKE2b-256 293c81b51b6876fc68b2fa4a818e2519152c2d447023b32c573a5341eed33f63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page