skeleton_prune3d — 3D medial op

• Data kinds: voxel → voxel

• Call: import fullseye as fs; fs.ledger.skeleton_prune3d(vol, length=1) (to call the implementation directly, import medial; medial.skeleton_prune3d(vol, length=1); from the registry, ops3d.get("skeleton_prune3d"))

Usage

Prune the whiskers (short branches) of a 3-D skeleton. Endpoint removal repeated length times = branches of length <= length are removed.

3D version of the 2D pruning. Isolated voxels are treated as endpoints and disappear.

Procedure: convert to bool with _ensure_skeleton (if there is an interior voxel, thin with skeletonize_vol), then repeat the following length times: remove all voxels with 26-neighbourhood degree <= 1 (endpoints and isolated points) simultaneously. It stops early when the skeleton becomes empty or has no endpoints left (when only closed loops remain).

Arguments: length is converted with int(length) and clamped to 0 if negative (with 0 the thinned skeleton is returned as-is). 1 iteration removes the 1 tip voxel of every branch, so branches (spurs) of length <= length voxels disappear down to their root.

Returns: a bool array of the same shape as the input.

Caveats (behaviour to know about):

• Long branches also become length voxels shorter from their tips (this is not a process that selectively removes only spurs). If you need the endpoint positions of main branches, the endpoints after pruning lie length inside the original ones.

• A short branch between 2 branch points does not disappear, because both its ends are branch points (degree >= 3).

• Isolated voxels disappear in the 1st iteration.

• The degree is recounted every iteration, so the cost is proportional to length.

Validation (ValueError): input that is not 3-D, an empty array, or containing NaN/Inf. If thinning is needed and scikit-image is missing, ImportError. Downstream: skeleton_endpoints3d / skeleton_junctions3d / skeleton_branches3d / topology_signature.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

• medial_topology — py -3.11 examples_3d/medial_topology.py

Ops the type connects to (they accept voxel as input)

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

Same category (medial)

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


*Provenance: medial.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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