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#

  1. Stitching — assembles tiles into a single volume for each channel.

  2. Registration — resamples the autofluorescence channel and aligns it to the atlas via Elastix.

  3. Binarization (per TubeMap channel) —

    1. binarize_channel() — multi-path thresholding.

    2. smooth_channel() — topology-preserving binary smoothing.

    3. fill_channel() — parallel 3-D binary hole filling.

    4. deep_fill_channel() — CNN-based hollow-tube filling (requires GPU with ≥ 24 GB VRAM).

  4. combine_binary() — logical-OR merge of all channel masks into a single combined binary.

  5. Graph construction

    1. pre_process() — skeletonize → build raw graph → clean → reduce → register to atlas.

    2. post_process() — iterative artery/vein tracing and capillary removal (if artery channel present).

    3. 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 masks

  • binary_combined.npy — merged vessel mask

  • skeleton.npy — skeletonized binary

  • graph_raw.gt / graph_cleaned.gt / graph_reduced.gt / graph_annotated.gt — graph at each construction stage

  • density_branches.tif — voxelized vessel density in atlas space

  • vertices.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.

main(src_directory)[source]#