cell_map_new_api#
Headless entry point for the CellMap pipeline (cell detection and density mapping).
This script replaces the deprecated ClearMap.Scripts.CellMap.
It initialises a sample from the experiment directory, runs stitching and
atlas registration, then detects cells, filters them, aligns coordinates to
atlas space, and produces voxelized density maps for every CellMap channel.
Usage#
conda activate ClearMap3.1
python -m ClearMap.Scripts.cell_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.
Cell detection (per CellMap channel) —
run_cell_detection()— background subtraction, maxima detection, shape-based watershed.post_process_cells()— intensity/size filtering and atlas-space coordinate alignment.voxelize()— rasterise cell positions into a density volume.Plots the density map and a 3-D scatter of cells coloured by atlas region.
Outputs (written to the experiment directory via the workspace)#
cells_raw.npy— raw detected cell table per channelcells_filtered.npy— filtered cell tablecells.feather— atlas-annotated cell table (coordinates + region labels)cells_stats.csv— per-structure cell counts and average sizesdensity_counts.tif— voxelized cell density in atlas space
See also
CellDetector:The worker class that implements each detection step.
init_sample_manager_and_processors():Convenience factory used to initialise all standard workers.
- CellMap :
Full CellMap pipeline documentation.