Registry / data / edt
library3.1.1pypypi✓ verified 85d ago

Computes the Euclidean distance transform of 3D and 2D label fields. Supports anisotropic voxels (non-cubic) and multi-label segmentation. v3.1.1, updated June 2024, active development with irregular releases.

pip install edt
INSTALL
IMPORT
SIG · EDT
E
edt
datapythonv3.1.1
Install
3.8s avg
Import
294ms
Disk
99MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.8s · import 0.294s · 98MB
99MB installed
● package 99MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

edt
import edt
from edt import edt
edt is a module, not a function within edt; top-level import is correct.

Compute Euclidean distance transform for a 3D label array. Use anisotropic parameter to set voxel size.

import edt import numpy as np labels = np.array([[[0, 1, 0], [1, 0, 0], [0, 0, 2]]], dtype=np.uint32) dist = edt.edt(labels, anisotropic=(1.0, 1.0, 1.0)) print(dist) # Output: 3D distance transform (x, y, z axes)
Debug
Known issues
gotchaedt.edt expects uint32 or uint64 labels by default. Passing int32 or float labels will silently produce incorrect results.
fix
Convert labels to np.uint32 or np.uint64 before calling edt.edt.
affects: all
gotchaAnisotropic parameter must be a tuple of three floats (for 3D) or two floats (for 2D). Omitting or using wrong shape leads to undefined behavior.
fix
Always provide anisotropic as (sx, sy, sz) tuple for 3D, or (sx, sy) for 2D.
affects: all
gotchaedt.edt modifies the input array in-place if the 'in_place' parameter is True (default False). Unexpected side effects may occur.
fix
If you need to preserve the original array, set in_place=False (the default) or pass a copy.
affects: all
deprecatedThe 'parallel' parameter (int) was deprecated in 3.0.0 and removed in 3.1.0. Use 'num_threads' instead.
fix
Use num_threads=N instead of parallel=N.
affects: >=3.0.0 <3.1.0
Errors
Common errors & fixes
ImportError: cannot import name 'edt' from 'edt'
Trying to import edt as from edt import edt, but edt is the module itself.
fix
Use just 'import edt' then call 'edt.edt()'.
ValueError: ndim is 2 but expected 3
Passed a 2D array to edt.edt without specifying ndim=2 or using the 2D variant.
fix
For 2D arrays, use edt.edt(..., ndim=2) or call edt.edt2d() if available (not in current version).
TypeError: anisotropic must be a tuple of floats
Anisotropic parameter passed as list or wrong type.
fix
Pass anisotropic as a tuple of three floats, e.g., (0.5, 0.5, 1.0).
Upgrade
Version history
3.1.1latest on PyPI · released Mar 1, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
edt — pip install edt · libregistry