skillfed

edt

Multi-Label Anisotropic Euclidean Distance Transform 3D

edt v3.1.2 101.5K downloads/30d#12,926 on PyPI267
Copyleft license LGPL-3.0-or-later Active released

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 edt

uv

uv add edt

poetry

poetry add edt

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Utilities

Tags

euclidean distance transform 3dmulti-label distance transformanisotropic distance transformedt labeled imagedistance field computationconnectomics distance transformvoxel distance calculation
image-processingconnectomicsvolumetric-data

More Scientific/Engineering packages