Skip to main content
Files added late

4 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

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.

pip install numpy
pip install edt

Recompiling edt.pyx

Requires Cython and a C++ compiler

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.

parallel controls the number of threads. Set it <= 0 to automatically determine your CPU count.

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', parallel=1) 

Metadata

Release files for edt 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Files added late

4 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for edt 1.3.2
File Size Uploaded
edt-1.3.2.tar.gz 172.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for edt 1.3.2
File
edt-1.3.2-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
edt-1.3.2-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
edt-1.3.2-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
edt-1.3.2-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
edt-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
edt-1.3.2-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
edt-1.3.2-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
edt-1.3.2-cp36-cp36m-macosx_10_13_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.13+ x86-64 Details
edt-1.3.2-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details
edt-1.3.2-cp27-cp27m-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 Details
edt-1.3.2-cp27-cp27m-macosx_10_14_intel.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.14+ Intel (x86-64, i386) Details

Total release size: 7.0 MB

Release files / edt-1.3.2.tar.gz

Download URL edt-1.3.2.tar.gz
Size 172.2 kB
Tags Source
SHA-256 checksum
How to use checksums
accf53fab874c714398ba851e4886e41be98316adaa8b9af6963d4b6ea86b7f0
BLAKE2b-256 checksum
How to use checksums
4c8bef3f7f4c9f627452eba5522ed0da30e904a5c8511c6ab8016b3287cefc7b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / edt-1.3.2-cp38-cp38-manylinux1_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL edt-1.3.2-cp38-cp38-manylinux1_x86_64.whl
Size 1.1 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
24fc87545c89007ed9c89bdfec8e9ca69613b927720228fec0ce049cc199242c
BLAKE2b-256 checksum
How to use checksums
925f6cd0f78a669c090f4f104d4ae5e0817c3a911eace4fd7b873a1c678c2e14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

Release files / edt-1.3.2-cp38-cp38-macosx_10_9_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL edt-1.3.2-cp38-cp38-macosx_10_9_x86_64.whl
Size 197.6 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
93fb8da864d19fec165d45ec53977131ca1e09e7379558fb6b87e3a28d4ca851
BLAKE2b-256 checksum
How to use checksums
b741ca0f0997e8c36846841edf7aa051e4f97e438bea1ce0b091c0457423bee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

Release files / edt-1.3.2-cp37-cp37m-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL edt-1.3.2-cp37-cp37m-win_amd64.whl
Size 245.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0731d28e54194049417447a8b88f6a03cb903fbcbfd60652fd03d06efbf9a429
BLAKE2b-256 checksum
How to use checksums
8e5103f5e34317a0ffde4e435301b713cf15b58345083890c89151c92aa1fbca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4rc2

Release files / edt-1.3.2-cp37-cp37m-manylinux1_x86_64.whl

Download URL edt-1.3.2-cp37-cp37m-manylinux1_x86_64.whl
Size 1.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
556c72dab835b020c502617f0c7aa32e79c36bd32d9928afcc7959a4b82bcb3d
BLAKE2b-256 checksum
How to use checksums
b157b971f9255dcda9ed5cfe43679b8aeb2799a2cf3089c6363d0dba58b11846
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / edt-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL edt-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
Size 196.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
093881fb7aa9d3bf1cc421bb3e0ac104c4a428e7c419d28dc5a755a5cac8fcc7
BLAKE2b-256 checksum
How to use checksums
c4a1599097841fa42de3e1ae5501f26e7ec67ceec697cbe4ddb15c184e68fe29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/2.7.10

Release files / edt-1.3.2-cp36-cp36m-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL edt-1.3.2-cp36-cp36m-win_amd64.whl
Size 235.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f839a956a7de1f7fb87a16688b898489ee969058363a69daf556cbb4a8f4a539
BLAKE2b-256 checksum
How to use checksums
4178c51ee8fc531402fe6daa73e49ab0e849f55a27896a351fb7e0d330b7c4a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release files / edt-1.3.2-cp36-cp36m-manylinux1_x86_64.whl

Download URL edt-1.3.2-cp36-cp36m-manylinux1_x86_64.whl
Size 1.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
de07cfe132f17636e8595b31095c7466473a7344be3564bb23f2bd549b260a59
BLAKE2b-256 checksum
How to use checksums
086abb7c5c1b720dbd84da59649e9fc175c991f2cb1a42df1a84b87a947556d7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / edt-1.3.2-cp36-cp36m-macosx_10_13_x86_64.whl

Download URL edt-1.3.2-cp36-cp36m-macosx_10_13_x86_64.whl
Size 200.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
3d23f148cb156314ed092148fff6984f9c63e77f158dbe344adf3942d16bf39b
BLAKE2b-256 checksum
How to use checksums
e843567047e7512bc4b414c0df24b09faa52c4f744c6dd5fe39daed7b5c72b41
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / edt-1.3.2-cp35-cp35m-manylinux1_x86_64.whl

Download URL edt-1.3.2-cp35-cp35m-manylinux1_x86_64.whl
Size 1.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
f2321626c628fb015a70a939f1dac6b883444eae0997f11c2eccb70165653e84
BLAKE2b-256 checksum
How to use checksums
07ecb1b8fdb18636f19f90cdb8316fabb7030e19c5c2a9f5a9cc49541dd3c6fd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / edt-1.3.2-cp27-cp27m-manylinux1_x86_64.whl

Download URL edt-1.3.2-cp27-cp27m-manylinux1_x86_64.whl
Size 1.1 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
648f0db69c93fbd1d75d99dc750ecfd0b8a44b84bcbde125bc93fb4fcb02e560
BLAKE2b-256 checksum
How to use checksums
980c67eb5aac2e03970d02c5f70e5336b9795f6adf81cabc5587eebe93bf639b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / edt-1.3.2-cp27-cp27m-macosx_10_14_intel.whl

Download URL edt-1.3.2-cp27-cp27m-macosx_10_14_intel.whl
Size 193.7 kB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.14+ Intel (x86-64, i386)
SHA-256 checksum
How to use checksums
71f7b25a2fbd2036ff31280507075cc56185b50d7a9fc518350fd9819fa08928
BLAKE2b-256 checksum
How to use checksums
725dd3197fa0f42f2154bff494a6db8d5d100c2ca7232c6f07a94a005322febd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/2.7.10

Release history Release notifications | RSS feed

3.1.0

33 release files

2.4.1

36 release files

2.4.0

42 release files

2.3.2

42 release files

2.3.1

36 release files

2.3.0

35 release files

2.1.2

34 release files

2.1.0

23 release files

2.0.5

21 release files

2.0.4

21 release files

2.0.3

19 release files

2.0.2

29 release files

2.0.1

14 release files

2.0.0

13 release files

This release

1.3.2 This release

12 release files

1.3.1

5 release files

1.3.0

5 release files

1.2.4

5 release files

1.2.3

7 release files

1.2.2

8 release files

1.2.1

8 release files

1.2.0

8 release files

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page