--- id: edt version: "3.1.2" license: LGPL-3.0-or-later license_treatment: copyleft maintenance: active --- # edt — Multi-Label Anisotropic Euclidean Distance Transform 3D License: copyleft · Maintenance: active · Downloads: 101.5K/mo ## 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 above — 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 pip install edt uv add edt 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_current - Install friction: medium - Maintenance: active - Downloads: 101.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags euclidean distance transform 3d, multi-label distance transform, anisotropic distance transform, edt labeled image, distance field computation, connectomics distance transform, voxel distance calculation, image-processing, connectomics, volumetric-data [View on SkillFed](https://skillfed.io/packages/edt) · [View on PyPI](https://pypi.org/project/edt/)