vol_distance_transform — 3D medial op

• 데이터 종류: voxel → voxel

• 호출: import fullseye as fs; fs.ledger.vol_distance_transform(vol_binary, spacing=None)(구현을 직접 호출하려면 import volops; volops.vol_distance_transform(vol_binary, spacing=None), 원장에서 가져오려면 ops3d.get("vol_distance_transform"))

• GPU: 있음(허용 목록의 기계적 GPU 경로, CuPy). device="auto" 는 측정한 크기(16,777,216 픽셀) 이상에서 GPU를 선택

사용법

이진 볼륨의 엄밀 유클리드 거리 변환.

> 아래 상세 설명은 원문입니다 —— 요약과 제목은 번역되어 있습니다.

Each foreground (non-zero) voxel is labelled with its Euclidean distance to the nearest background voxel, via scipy.ndimage.distance_transform_edt. Pass *spacing* (sz, sy, sx) (e.g. VolumeMeta.spacing_mm, or the VolumeMeta itself) to make the distance anisotropy-aware — millimetres rather than voxels; otherwise unit spacing is assumed. A non-{0, 1} input is thresholded at > 0.5.

Returns a (D, H, W) float64 distance field (0 on the background). Outside the volume is not background (a foreground slab touching the edge keeps growing towards it). With no background voxel at all the nearest background is infinitely far: every voxel is inf (the 2-D distance_transform returns its normalised maximum 1.0 in the same case). This op returns absolute distances, so the 2-D convention (normalise to 1.0) does not carry over; inf was chosen over raising so that a mixed batch keeps its shape. Dividing by the maximum afterwards gives NaN — check np.isinf first.

Reference: Felzenszwalb & Huttenlocher, Theory of Computing 2012.

Empty input (vol_binary with 0 elements) raises ValueError.

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

• medial_topology — py -3.11 examples_3d/medial_topology.py

• molecule_atom_count — py -3.11 examples_3d/molecule_atom_count.py

• nearest_seed_partition — py -3.11 examples_3d/nearest_seed_partition.py

• vessel_metrology — py -3.11 examples_3d/vessel_metrology.py

타입이 이어지는 다음 연산자(voxel 를 입력으로 받는 것)

voxel_to_mips · voxel_to_mesh · signed_distance_field · to_points · sobel3d · hessian3d · curvature_maps · edt_jfa

같은 카테고리(medial)

distance_ridge · skeletonize_vol · medial_axis_points · topology_signature · medial_match · skeleton_junctions3d · skeleton_endpoints3d · skeleton_prune3d


*Provenance: volops.py — 3D 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.