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

Uploaded Source

Built Distributions

edt-1.2.2-cp37-cp37m-manylinux1_x86_64.whl (529.5 kB view details)

Uploaded CPython 3.7m

edt-1.2.2-cp36-cp36m-manylinux1_x86_64.whl (534.9 kB view details)

Uploaded CPython 3.6m

edt-1.2.2-cp36-cp36m-macosx_10_13_x86_64.whl (146.1 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

edt-1.2.2-cp35-cp35m-manylinux1_x86_64.whl (515.7 kB view details)

Uploaded CPython 3.5m

edt-1.2.2-cp34-cp34m-manylinux1_x86_64.whl (523.2 kB view details)

Uploaded CPython 3.4m

edt-1.2.2-cp27-cp27m-manylinux1_x86_64.whl (508.6 kB view details)

Uploaded CPython 2.7m

edt-1.2.2-cp27-cp27m-macosx_10_14_intel.whl (151.6 kB view details)

Uploaded CPython 2.7m macOS 10.14+ intel

File details

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

File metadata

  • Download URL: edt-1.2.2.tar.gz
  • Upload date:
  • Size: 166.8 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.2.tar.gz
Algorithm Hash digest
SHA256 e1306fd8aaf89805a05709ea3ec9ddcac2c69677c3ddc1597e603afc3df22446
MD5 51a11f4211c84071ce59d8ebef9b4819
BLAKE2b-256 d70026420d84fad55775868b5195bb3b913780672c6062034ac1df587c5ea83a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 529.5 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.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e07cb03820cd8dab039c290392e1389b2a8edb7b135a8faac5bca1e126b82a39
MD5 295e1f68859f344c63492af8ccb3e6a3
BLAKE2b-256 5073448b3d4164f0359990f6bd1d7e7d9122f054cdbf30250593835e7a3f6452

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 534.9 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.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 04dc8bfd145032a8838124e3bd02575007f60c39b978eb96f02d6dbc7da62e23
MD5 860502536cca21edd95a26dfff428364
BLAKE2b-256 fd47ce9f76881a8e2774854ddd561dc5234e956dde4229db4c4f56daa537b213

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.2-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 146.1 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.2-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7a927ece30511c196c33a8377a80b21b5f4fbbc6d93f4c35555bde5ffdb65a45
MD5 f4d7597fd7212eaba81a53a4cc956273
BLAKE2b-256 1ee64537880bed7c28284a051aec5f6629accb3068f9f39cd3dfe34bd7a6be94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 515.7 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.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e322515e4bce7cb8c9e826b680f84d13484daa7234ad3c558a1e7d53162e13f7
MD5 bb45cfa11dd5c7d530a5813992539d29
BLAKE2b-256 55dc52b2ce775b851b87959b163568dc7b108416d77931cb35e30c3b149551d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.2-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 523.2 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.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 84d13699611fff5257ba4adf44ef9bea3e3f2b3790ec80c8e34f8de201c150bc
MD5 1687f90d66dff6c35b12b3cd36123882
BLAKE2b-256 6f98f867d01c81be4e3be997cbb2520a480dc8acb19cc186aad9e64da0b78c43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.2-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 508.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/3.6.6

File hashes

Hashes for edt-1.2.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 beae0d535d3f1ce858a71290d4525eab4d2cf0d66c5e7b24cff006c4bce4cc48
MD5 f889405d9149c72b257c034ef038aec5
BLAKE2b-256 1b87e8cb8719bd57592a5e1f853ee688b25f1860c87ced8456105c302dffae70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.2-cp27-cp27m-macosx_10_14_intel.whl
  • Upload date:
  • Size: 151.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.2-cp27-cp27m-macosx_10_14_intel.whl
Algorithm Hash digest
SHA256 334c218f0f0275d86da162e6c64418caa4296c48352e3895f3b749e15e5a6938
MD5 247f5c9531b5e71f46a1ac72aa097af1
BLAKE2b-256 e2e9f30cfcf13d9f00eaa2b0d57e8c9be1e55a22f681b6985b1736f1694a71aa

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