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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

edt-1.2.4-cp37-cp37m-manylinux1_x86_64.whl (534.9 kB view details)

Uploaded CPython 3.7m

edt-1.2.4-cp36-cp36m-manylinux1_x86_64.whl (537.6 kB view details)

Uploaded CPython 3.6m

edt-1.2.4-cp35-cp35m-manylinux1_x86_64.whl (513.1 kB view details)

Uploaded CPython 3.5m

edt-1.2.4-cp27-cp27m-manylinux1_x86_64.whl (501.4 kB view details)

Uploaded CPython 2.7m

File details

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

File metadata

  • Download URL: edt-1.2.4.tar.gz
  • Upload date:
  • Size: 167.2 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.4.tar.gz
Algorithm Hash digest
SHA256 d3604509b7cc1410b0226b0b5e34a962689a52abe33b69f983109402e2b8d0bd
MD5 e941bec05783eaebf9dc1305ed2fcbb4
BLAKE2b-256 a51cf4dc0f2eb965415414cfa336257cecf81918383a2d787bd1e91b0a476cbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.4-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 534.9 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.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1c44636399427692f5960b766ae9aa8c60cebb20bb7e8c86287e385f81f2a3be
MD5 c63a197fe30476d3ca9d8cdc0d7db0a9
BLAKE2b-256 b1a1463e6702e7a8f54b3da6dfdab00490e1f2f470e0d98b80e06dbdafededfa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.4-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 537.6 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.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 db4a51ae90934f9508c0a7e84468d75588a63ae8e1f3e698598db2957659aa64
MD5 2da339a8276893b0c25a9d148c0d1a7b
BLAKE2b-256 7a706530acb9ed9468279610e55c4415636b429e8bd4f41ee994351b75e98698

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.4-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 513.1 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.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f214ef6362b2e397fefc86346dbd73a5f72899ae7fe675d7666fbf7a052bfee3
MD5 ab6b90edc4cb83c5b57b5f98a37f11f7
BLAKE2b-256 32a4c56d2e29592b57c50de792c3006d0efb26711e8c6e37ef0137619ae87eb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.4-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 501.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.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e29231fdb6dac7f5b2c54f1ef40b3bd73f6912feaed72ce0214d5184bf364562
MD5 0b870b91f1e48727a7e36d08b8a471fe
BLAKE2b-256 7090cd3e6982a8ac126973466f21a80220eb0d657193f2a0ba204e690da858ea

See more details on using hashes here.

Supported by

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