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 edtVerified import paths — ran on the pinned version, not inferred.
Compute Euclidean distance transform for a 3D label array. Use anisotropic parameter to set voxel size.
Convert labels to np.uint32 or np.uint64 before calling edt.edt.
Always provide anisotropic as (sx, sy, sz) tuple for 3D, or (sx, sy) for 2D.
If you need to preserve the original array, set in_place=False (the default) or pass a copy.
Use num_threads=N instead of parallel=N.
Use just 'import edt' then call 'edt.edt()'.
For 2D arrays, use edt.edt(..., ndim=2) or call edt.edt2d() if available (not in current version).
Pass anisotropic as a tuple of three floats, e.g., (0.5, 0.5, 1.0).
No dependency data recorded yet.