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.1.tar.gz (166.0 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.1-cp37-cp37m-manylinux1_x86_64.whl (520.2 kB view details)

Uploaded CPython 3.7m

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6mmacOS 10.13+ x86-64

edt-1.2.1-cp35-cp35m-manylinux1_x86_64.whl (510.2 kB view details)

Uploaded CPython 3.5m

edt-1.2.1-cp34-cp34m-manylinux1_x86_64.whl (516.6 kB view details)

Uploaded CPython 3.4m

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7mmacOS 10.14+ Intel (x86-64, i386)

File details

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

File metadata

  • Download URL: edt-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 892229e6135b65e2aa75e81740926533e45b6cfbdad9168c439110d450163396
MD5 19477867755e0f6dff1e5191334f0bfb
BLAKE2b-256 705fa8a236d9c849447590e90d7693c0cdb73b18e175f6835e3daa96049c618f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 520.2 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.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 778163e0c9bfc766484cfdfc678bbd714cd6535b4aae07c1d410b5ef3f1b4245
MD5 1e88ba41155139a00f51c0a50a491923
BLAKE2b-256 4472fcee67aca6b56ed33b6dd004e63c0ee279ca77b57e3cb2e5d90995be38e3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.1-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.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6e1ce4090e3014d14265574aa0ef97d47546bad650ff5bb7b2706c8bb1e739cb
MD5 0d3d2a635e72e762bfd540e2e010cdb8
BLAKE2b-256 93a04f1a39522581e0883986dfbc045ca92fec50d0d322e2a00a623228717f04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.1-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.1-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 926e2cfe5f43bd62940569449633021ff7519f5481fe58675de6d396928b4199
MD5 ed4f061360c938762378c63fac786858
BLAKE2b-256 98997c45cf02108d3a07acc11f02e4aa7f5f3a66bdf7156b9d4b266509b27698

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.1-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 510.2 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.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4221faaf766d17087741f0b686aaf5f7817722e398489ce4628f8c9f89dfb793
MD5 4d3ca41a08c12b8bb23d73b375c44f73
BLAKE2b-256 4b7ebddcd32e90e9eef65bbc36c7d1f3285f38e3642b767c32bc177a9ae9d47a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.1-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 516.6 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.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 91b761db275a2cca3f5b9f2db91cc81bda5331209623cddf1a403ccebd5c672b
MD5 29c0c7fd4cf27643571fdd93dda1713c
BLAKE2b-256 7b31fdd8d325748579c2eaa9275b08489a3c926974f5d80307d23ea9368cf82a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.1-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.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f1c22034bbc11bd1cee0de8e46cfe1abbc2c0c8d33cc2889806f52e153a226a6
MD5 ddb37932a9a5b4ec764c9acbc52ae08c
BLAKE2b-256 27950dd183cdabd6e6ca9b96773f026b867b3cb96c6c9ca1d794b9dc6b29cfb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edt-1.2.1-cp27-cp27m-macosx_10_14_intel.whl
  • Upload date:
  • Size: 149.8 kB
  • Tags: CPython 2.7m, macOS 10.14+ Intel (x86-64, i386)
  • 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.1-cp27-cp27m-macosx_10_14_intel.whl
Algorithm Hash digest
SHA256 eced2a744f088707baa67eb11bb07bbd03ec5a27213dfc5070c4c2fb6fbb1101
MD5 109c3049c5ce384e28b91b789dda4db9
BLAKE2b-256 3873b0e49d0ab2a747ba72017b37ae3cb2da8bfded5d74db6d88386167a677d8

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