edt
Multi-Label Anisotropic Euclidean Distance Transform 3D
What it is and what it does
edt is a compiled Python library that computes Euclidean distance transforms on labeled volumetric data. It handles 1D, 2D, and 3D arrays and supports anisotropic voxel spacing (e.g., different resolutions along each axis), which is common in microscopy and connectomics datasets. The package processes multiple labels simultaneously in a single pass, avoiding the need to compute transforms separately for each label.
The library is built on a C++ core with a Python wrapper and depends only on numpy. It offers both standard Euclidean distance and squared Euclidean distance variants, signed distance fields, and optional multi-threaded computation. Special optimizations exist for binary images. The package is designed for scientific and research workflows, particularly in connectomics and image analysis, where large labeled volumes require fast distance computations.
Use it for:
- Compute distance transforms on densely labeled 3D connectomics volumes to support skeletonization algorithms like TEASAR.
- Correct for anisotropic voxel spacing in microscopy data (e.g., different X/Y vs. Z resolution) during distance field computation.
- Extract individual label components from a multi-label volume and process their distance transforms sequentially.
- Generate signed distance fields for geometric analysis of labeled structures in volumetric medical or biological imaging.
- Accelerate batch distance transform operations on binary images using specialized optimizations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes Euclidean distance transforms for 1D, 2D, or 3D labeled images with support for multiple labels and anisotropic voxel dimensions in a single pass.
Yes. edt is actively maintained, production-stable, has no known vulnerabilities, and offers genuine performance advantages for multi-label and anisotropic distance transforms in scientific workflows. The LGPL-3.0-or-later license requires compliance review if used in proprietary software. Medium install friction is acceptable given prebuilt wheels for common platforms; source builds require a C++ compiler.
Install
edt on PyPI
pip
pip install edtuv
uv add edtpoetry
poetry add edtInstalling edt
Before you install
Medium install friction due to compiled C++ components; prebuilt wheels available for Python 3.10–3.13 on macOS (x86_64 and ARM64), Linux (x86_64 and aarch64), and Windows; source installation requires a C++ compiler. Package is actively maintained with recent releases.
License in practice
Licensed under LGPL-3.0-or-later (copyleft). Derivative works and modifications must be distributed under compatible terms; static or dynamic linking in proprietary software may require license compliance review.
Quickstart
import edt
import numpy as np
labels = np.ones(shape=(512, 512, 512), dtype=np.uint32, order='F')
dt = edt.edt(labels, anisotropy=(6, 6, 30), black_border=True, parallel=4)
Requires numpy; source installation requires a C++ compiler and development headers (e.g., python3-dev on Linux).
Verify before relying
- Performance characteristics for typical connectomics workloads (e.g., actual speedup vs. scipy.ndimage.distance_transform_edt).
- Memory overhead of voxel_graph feature and practical use cases beyond the experimental warning.
Package facts
| License | LGPL-3.0-or-later (copyleft) |
| Python support | supports the current Python release (<4,>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 43 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 101,514/month — #12,926 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: edt-3.1.2-cp310-cp310-macosx_10_9_x86_64.whl; edt-3.1.2-cp310-cp310-macosx_11_0_arm64.whl; edt-3.1.2-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; edt-3.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; edt-3.1.2-cp310-cp310-win32.whl; edt-3.1.2-cp310-cp310-win_amd64.whl; edt-3.1.2-cp311-cp311-macosx_10_9_x86_64.whl; edt-3.1.2-cp311-cp311-macosx_11_0_arm64.whl; edt-3.1.2-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; edt-3.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; edt-3.1.2-cp311-cp311-win32.whl; edt-3.1.2-cp311-cp311-win_amd64.whl; edt-3.1.2-cp312-cp312-macosx_10_13_x86_64.whl; edt-3.1.2-cp312-cp312-macosx_11_0_arm64.whl; edt-3.1.2-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; edt-3.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; edt-3.1.2-cp312-cp312-win32.whl; edt-3.1.2-cp312-cp312-win_amd64.whl; edt-3.1.2-cp313-cp313-macosx_10_13_x86_64.whl; edt-3.1.2-cp313-cp313-macosx_11_0_arm64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
connected-components-3dLabels connected components in 2D and 3D images…
copyleft · top 15,000 on PyPI
fastremapRemap, renumber, and relabel NumPy arrays at…
copyleft · top 15,000 on PyPI
opensimplexGenerates OpenSimplex noise across 2D, 3D, and…
permissive · top 15,000 on PyPI
spatial_imagespatial-image provides an N-dimensional spatial…
permissive · top 15,000 on PyPI
scannScaNN performs efficient vector similarity…
permissive · top 15,000 on PyPI
batchgeneratorsbatchgenerators provides data augmentation…
permissive · top 15,000 on PyPI
e3nn-jaxImplements equivariant convolutional neural…
permissive · top 15,000 on PyPI
e3nne3nn provides PyTorch-based operations for…
permissive · top 15,000 on PyPI
simsimdSimSIMD provides SIMD-optimized kernels for…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI