Skip to main content

Multi-Label Anisotropic Euclidean Distance Transform 3D

Project description

## Python Instructions for MLAEDT-3D

Compute the Euclidean Distance Transform of a 1d, 2d, or 3d labeled image containing multiple labels in a single pass with support for anisotropic dimensions.

### Python Installation

*Requires a C++ compiler*

The installation process depends on `edt.cpp` for the Python bindings derived from `edt.pyx`. `edt.hpp` contains the algorithm implementation.

```bash
pip install numpy
pip install edt
```

### Recompiling `edt.pyx`

*Requires Cython and a C++ compiler*

```bash
cd python
cython -3 --cplus edt.pyx # generates edt.cpp
python setup.py develop # compiles edt.cpp and edt.hpp
# together into a shared binary e.g. edt.cpython-36m-x86_64-linux-gnu.so
```

### Python Usage

Consult `help(edt)` after importing. The edt module contains: `edt` and `edtsq` which compute the euclidean and squared euclidean distance respectively. Both functions select dimension based on the shape of the numpy array fed to them. 1D, 2D, and 3D volumes are supported. 1D processing is extremely fast. Numpy boolean arrays are handled specially for faster processing.

If for some reason you'd like to use a specific 'D' function, `edt1d`, `edt1dsq`, `edt2d`, `edt2dsq`, `edt3d`, and `edt3dsq` are available.

The three optional parameters are `anisotropy`, `black_border`, and `order`. Anisotropy is used to correct for distortions in voxel space, e.g. if X and Y were acquired with a microscope, but the Z axis was cut more corsely.

`black_border` allows you to specify that the edges of the image should be considered in computing pixel distances (it's also slightly faster).

`order` allows the programmer to determine how the underlying array should be interpreted. `'C'` (C-order, XYZ, row-major) and `'F'` (Fortran-order, ZYX, column major) are supported. `'C'` order is the default.

```python
import edt
import numpy as np

# e.g. 6nm x 6nm x 30nm for the S1 dataset by Kasthuri et al., 2014
labels = np.ones(shape=(512, 512, 512), dtype=np.uint32, order='F')
dt = edt.edt(labels, anisotropy=(6, 6, 30), black_border=True, order='F')
```



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

edt-1.2.0.tar.gz (166.0 kB view details)

Uploaded Source

Built Distributions

edt-1.2.0-cp37-cp37m-manylinux1_x86_64.whl (520.1 kB view details)

Uploaded CPython 3.7m

edt-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (526.0 kB view details)

Uploaded CPython 3.6m

edt-1.2.0-cp36-cp36m-macosx_10_13_x86_64.whl (144.6 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

edt-1.2.0-cp35-cp35m-manylinux1_x86_64.whl (510.5 kB view details)

Uploaded CPython 3.5m

edt-1.2.0-cp34-cp34m-manylinux1_x86_64.whl (516.7 kB view details)

Uploaded CPython 3.4m

edt-1.2.0-cp27-cp27m-manylinux1_x86_64.whl (503.4 kB view details)

Uploaded CPython 2.7m

edt-1.2.0-cp27-cp27m-macosx_10_14_intel.whl (149.8 kB view details)

Uploaded CPython 2.7m macOS 10.14+ intel

File details

Details for the file edt-1.2.0.tar.gz.

File metadata

  • Download URL: edt-1.2.0.tar.gz
  • Upload date:
  • Size: 166.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for edt-1.2.0.tar.gz
Algorithm Hash digest
SHA256 530030f8f8873e2924f22db547141a2f1b71de3b61c5d3f978d5952d661f09e3
MD5 62304b54d118e11748a17bb0e6cd5660
BLAKE2b-256 2491acfcf9071c40adac7e20ad21caae644ba822e99103e6fe4b00f875a867a4

See more details on using hashes here.

File details

Details for the file edt-1.2.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: edt-1.2.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 520.1 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for edt-1.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dd41872c50c3752547682d874e5b9e3e452e80d3c6b33e9de20df4c1e6d39a78
MD5 d19862ad5203bcdde42c198fb15830cd
BLAKE2b-256 2d38fe59b4c78d89c3887ea78da39fe7e7b94f7e7cb6cc89dff6fc87176afeb5

See more details on using hashes here.

File details

Details for the file edt-1.2.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: edt-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 526.0 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for edt-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 47bd00b3f67389eefb2cd6a63ce7923c327d826cc8b831e68bcc1edeff48b02d
MD5 e9ecc8eb1198d98142d676e3c6f0082f
BLAKE2b-256 cf1f9f4c3a60da3e97dac753e430bd3909f674ad02acc2efb65d63dcaa2db2f1

See more details on using hashes here.

File details

Details for the file edt-1.2.0-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: edt-1.2.0-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 144.6 kB
  • Tags: CPython 3.6m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for edt-1.2.0-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b1c0f5384419ff7bb7e15c65b701474ac3fbf87f1bb8f015595042c94b0dcdc5
MD5 f573e412ecbc6881f5bc47bc6768155f
BLAKE2b-256 8a67cddf357e12625aa76eafb96d0f60d693dcf96eee0ed0e039b3c17f7c989a

See more details on using hashes here.

File details

Details for the file edt-1.2.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: edt-1.2.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 510.5 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for edt-1.2.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5cd2fc67abb4c9dccc2be6cd1de3a614ee564bb248b5a11927b96e470c05ff9e
MD5 848415245b8447fa15027699f628d190
BLAKE2b-256 d3ea47f8e7a5b48a37f47bf28702fcbfac9adf9766afc73102bdced637679343

See more details on using hashes here.

File details

Details for the file edt-1.2.0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: edt-1.2.0-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 516.7 kB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for edt-1.2.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2118fa488116dcd40651fd383d613554b38596d1585beba8fa527d4605e21b6c
MD5 d9df1014bb22cd256b029fa7e9d16ddb
BLAKE2b-256 bee0e53dd2c595e2b20e36aac09463106b841bb5370a2902c3001362fa438372

See more details on using hashes here.

File details

Details for the file edt-1.2.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: edt-1.2.0-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 503.4 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for edt-1.2.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c21de5e044dbac95587207123cac1ba456faa039dacddda31fcc865bc14bed2a
MD5 1236febe7678a6fff788724a189d44b4
BLAKE2b-256 4086f8276839b47a002f7b53fe039c26f3676768384cdaed6d7da4d05f5c5d93

See more details on using hashes here.

File details

Details for the file edt-1.2.0-cp27-cp27m-macosx_10_14_intel.whl.

File metadata

  • Download URL: edt-1.2.0-cp27-cp27m-macosx_10_14_intel.whl
  • Upload date:
  • Size: 149.8 kB
  • Tags: CPython 2.7m, macOS 10.14+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.10

File hashes

Hashes for edt-1.2.0-cp27-cp27m-macosx_10_14_intel.whl
Algorithm Hash digest
SHA256 697300dbad4d42ab36139af8b3069e2935a129a52593892645a6051b73b7db05
MD5 d1e504ba63edf23224436dc8ba4d0db1
BLAKE2b-256 2b5bde5da7ba09afcee18468b351840f8b91508bc60c63ca9aace3e5d986c8f6

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