tube_map_new_api#
Headless entry point for the TubeMap pipeline (vasculature binarization, graph construction, and annotation).
This script replaces the deprecated ClearMap.Scripts.TubeMap.
It initialises a sample from the experiment directory, runs stitching and
atlas registration, then binarizes each vessel channel, merges the binary
masks, and builds an annotated vasculature graph.
Usage#
conda activate ClearMap3.1
python -m ClearMap.Scripts.tube_map_new_api /path/to/experiment
The experiment directory must contain a sample.yml config file (created
by the GUI or by copying from ~/.clearmap/defaults/). All pipeline
parameters are read from the YAML files in that directory; no editing of
this script is required.
Steps performed#
Stitching — assembles tiles into a single volume for each channel.
Registration — resamples the autofluorescence channel and aligns it to the atlas via Elastix.
Binarization (per TubeMap channel) —
binarize_channel()— multi-path thresholding.smooth_channel()— topology-preserving binary smoothing.fill_channel()— parallel 3-D binary hole filling.deep_fill_channel()— CNN-based hollow-tube filling (requires GPU with ≥ 24 GB VRAM).
combine_binary()— logical-OR merge of all channel masks into a single combined binary.Graph construction —
pre_process()— skeletonize → build raw graph → clean → reduce → register to atlas.post_process()— iterative artery/vein tracing and capillary removal (if artery channel present).voxelize()— rasterise graph vertices into a branch density volume.
Outputs (written to the experiment directory via the workspace)#
binary.npy/binary_smoothed.npy/ … — intermediate binary masksbinary_combined.npy— merged vessel maskskeleton.npy— skeletonized binarygraph_raw.gt/graph_cleaned.gt/graph_reduced.gt/graph_annotated.gt— graph at each construction stagedensity_branches.tif— voxelized vessel density in atlas spacevertices.feather— vertex table with coordinates, radii, and atlas labels
See also
BinaryVesselProcessor:Binarization worker.
VesselGraphProcessor:Graph construction and annotation worker.
init_sample_manager_and_processors():Convenience factory used to initialise all standard workers.
- TubeMap :
Full TubeMap pipeline documentation.