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#

  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. Cell detection (per CellMap channel) —

    1. run_cell_detection() — background subtraction, maxima detection, shape-based watershed.

    2. post_process_cells() — intensity/size filtering and atlas-space coordinate alignment.

    3. voxelize() — rasterise cell positions into a density volume.

    4. 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 channel

  • cells_filtered.npy — filtered cell table

  • cells.feather — atlas-annotated cell table (coordinates + region labels)

  • cells_stats.csv — per-structure cell counts and average sizes

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

main(src_directory)[source]#