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.3.tar.gz (167.4 kB view details)

Uploaded Source

Built Distributions

edt-1.2.3-cp37-cp37m-manylinux1_x86_64.whl (536.4 kB view details)

Uploaded CPython 3.7m

edt-1.2.3-cp36-cp36m-manylinux1_x86_64.whl (536.1 kB view details)

Uploaded CPython 3.6m

edt-1.2.3-cp36-cp36m-macosx_10_13_x86_64.whl (154.5 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

edt-1.2.3-cp35-cp35m-manylinux1_x86_64.whl (513.6 kB view details)

Uploaded CPython 3.5m

edt-1.2.3-cp27-cp27m-manylinux1_x86_64.whl (501.6 kB view details)

Uploaded CPython 2.7m

edt-1.2.3-cp27-cp27m-macosx_10_14_intel.whl (146.6 kB view details)

Uploaded CPython 2.7m macOS 10.14+ intel

File details

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

File metadata

  • Download URL: edt-1.2.3.tar.gz
  • Upload date:
  • Size: 167.4 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/2.7.10

File hashes

Hashes for edt-1.2.3.tar.gz
Algorithm Hash digest
SHA256 2ad5068977c96c07cb7a1a182913b53df87c6a2df47f282bf9bf23ac0e35ae8a
MD5 a3023c43d7967f55df6832e1fce31805
BLAKE2b-256 12bc8af2d9d19ab26f229a325eec7b0e01e23838b15010e883f2b179f8fe2220

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.3-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 536.4 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/2.7.10

File hashes

Hashes for edt-1.2.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d66d78ca61182676ab52dbfb6f4c12b3c881c4fc7d6e2bb96039798000349284
MD5 b1433908a985f39da47e8e51ff8afc48
BLAKE2b-256 75ec3e8158e20c220ac842c3205e111fcdfdb7bd481689f6fe09b0342697d080

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.3-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 536.1 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/2.7.10

File hashes

Hashes for edt-1.2.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a3e2b518332ce7e869474b0c250feb3f2ef560c85d81cc73b9db013e22e135ca
MD5 267ef668c06ff4ceba06898927b3a765
BLAKE2b-256 429688e43b65bbc0137955624b20b0f14e17b60c24ea08314ca9992fd2b84ec7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.3-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 154.5 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/2.7.10

File hashes

Hashes for edt-1.2.3-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 41e836aebc255c00a8b5f5a3cf7b96413b153570876fc336a1e72d4c0cf99f30
MD5 4a4baf71242ad794a80de1aab0606d2e
BLAKE2b-256 4fb808763bbe78d04231444ebaffb134926629d387cf2589464b5509816aec39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.3-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 513.6 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/2.7.10

File hashes

Hashes for edt-1.2.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c4b4f3903467f7bf6e459e853d6459fce5d06c2d17cd17d038f07b6e5c4ef56b
MD5 722287186bb5433b03d057ffdce81f2c
BLAKE2b-256 10d50c1084998227d84ed5a72d8d1c867b1e2f90eb948fb7eb5388e0df1ef34b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.3-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 501.6 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/2.7.10

File hashes

Hashes for edt-1.2.3-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8a6aae7da3e8c108b434e2bbd9c38de6dc129c6ad9720fd2b8a4665c41954ff5
MD5 0e6aa11208ef829b6966fbdd46a8c96d
BLAKE2b-256 5714ba22e3929ad161d810e38d9dbcae83a0dad98c5dcc1889bf143925238e43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.3-cp27-cp27m-macosx_10_14_intel.whl
  • Upload date:
  • Size: 146.6 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.3-cp27-cp27m-macosx_10_14_intel.whl
Algorithm Hash digest
SHA256 9b85a7fa2e64cd82ca23a787715ecf40ebc7c37c5b0e4e58e2d881ea516ebcac
MD5 b211a0d43d313adb296e3a8053765c18
BLAKE2b-256 0659323ff6a05d891688b1ae1dd58f9d22604152053a360d12f42026dedbc382

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