Brain registration (brainreg), segmentation post-processing, and
visualization for use-case / paper workflows.
This workflow has three phases:
- Registration (SLURM): run
brainregto create per-subject output folders withregistered_atlas.tiff. - Segmentation + probe annotations (Napari): open the registered subject outputs, add probe tracks/injections, and save into the subject’s
segmentation/folder. - Visualization (Python): render probe HTML and/or atlas+region PNG views from
segmentation/atlas_space/.
SLURM scripts, data, and outputs are kept together in one project folder (e.g. your NFS project directory). The SLURM config expects:
PROJECT_DIR/data— input TIFs (any subdirs)PROJECT_DIR/brainreg_outputs_<atlas>/— registration outputs
Copy/symlink the bg_viz_pipeline/slurm/ folder into your project folder
(preserving the slurm/ subfolder), and edit slurm/brainreg_config.sh to
set PROJECT_DIR.
See bg_viz_pipeline/slurm/README.md for details of how
the SLURM scripts work and how to run them.
At a minimum:
- edit
slurm/brainreg_config.sh - run
./slurm/submit_brainreg.sh
For each registered subject folder created by Phase 1:
- Open the subject in
napariusing your brainrender/segmentation workflow. - Add probe tracks/injections.
- Save back into the subject's
segmentation/folder in the locations expected by the Python visualizers:segmentation/atlas_space/tracks/*.npy- optional
segmentation/atlas_space/regions/*.obj
From the workflows repo root (so the bg_viz_pipeline/ package is
importable):
-
Probe HTML:
python -m bg_viz_pipeline.scripts.probes_to_html <atlas> <brainreg_dir> <out.html> [--regions ...]
-
Atlas viewer PNGs:
- configure
bg_viz_pipeline/presets/viewer_presets.json, then run:
- configure
python -m bg_viz_pipeline.scripts.brainreg_viewer # all presets
python -m bg_viz_pipeline.scripts.brainreg_viewer --only-subject ROI-1
python -m bg_viz_pipeline.scripts.brainreg_viewer --only-subdir ds_MPX-R-0033_...Use a conda environment with BrainGlobe installed
(e.g. brainglobe-env; pip install brainglobe).