Skip to content

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic contrast-agnostic claustrum segmentation at high-resolution (0.35 mm isotropic)

ffge

If you use this method, please cite:

A Constrast-Agnostic Method for Ultra-High Resolution Claustrum Segmentation, Mauri, C., Fritz, R., Mora, J., Billot, B., Iglesias, J.E., Van Leemput, K., Augustinack, J., Greve, D.N. Human Brain Mapping 46.12 (2025): e70303. Check out the paper

Now in the dev version of FreeSurfer with the command mri_claustrum_seg!

Installation

  1. Clone this repository and the SynthSeg repository
git clone https://github.com/chiara-mauri/claustrum_segmentation.git
git clone https://github.com/BBillot/SynthSeg.git
  1. Create a virtual environment (e.g. with conda) with python 3.8:
conda create -n synthseg_38 python=3.8 
conda activate synthseg_38
  1. Install SynthSeg in the conda environment. This will install all the required packages (e.g. tensorflow, keras)
cd SynthSeg 
pip install . 
  1. Install Freesurfer version 7.5.0 or higher (follow linked instructions), and source it:
export FREESURFER_HOME=<freesurfer_installation_directory>/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh

This last step is necessary for SynthMorph registration, to define the appropriate field of view around the claustrum and to perform quality control.

Now segment claustrum in one command!

csh /path-to-repo/claustrum_segmentation/mri_claustrum_seg --i <inputImage> --o <outputDir> [--threads <Nthreads>  --qc   --topo-correct  --post  --surf]

where:

  • --i : input image (any contrast and resolution)
  • --o : output directory
  • --threads (optional): number of threads (default 1)
  • --qc/--no-qc (optional): compute quality control score (default --no-qc)
  • --topo-correct/--no-topo-correct (optional): perform post-hoc topology correction on the claustrum segmentation (default --no-topo-correct)
  • --post/no-post (optional): save posteriors (default --no-post)
  • --surf/no-surf (optional): compute surfaces (default --no-surf)

Additional options are also available (optional):

  • --synthmorphdir <synthmorphdir> : supply directory with synthmorph registration instead of computing it
  • --lh, --rh : only do left hemisphere or right hemisphere (default is to do both)
  • --save-warp/--no-save-warp: save synthmorph warp when performing quality control (~180MB) (default is --save-warp)
  • --fovdir <fovdir> : supply the output directory of a claustrum segmentation to re-use the same field of view
  • --manseg-lh <manseglh> : compute dice against a provided manual segmentation for left claustrum (it should have the same ID as in the automatic segmentation, i.e. 138)
  • --manseg-rh <mansegrh> : compute dice against provided manual segmentation for right claustrum (it should have the same ID as in the automatic segmentation, i.e. 139)
  • --model <model> : use this model for claustrum segmentation instead of the default (requires training a model first)
  • --direct <input> <output> : run directly on input/output without preprocessing
  • --mni-1.0 : set MNI target resolution to 1mm instead of 1.5mm (only applies to quality control)"

The method outputs a folder containing:

  • claustrum.rh.nii.gz, claustrum.lh.nii.gz: images with claustrum segmentation at 0.35 mm isotropic resolution, for right and left hemisphere respectively. Following the FreeSurfer LookupTable, right claustrum has ID 139, left claustrum has ID 138
  • claustrum.prior.rh.nii.gz, claustrum.prior.lh.nii.gz: probabilistic atlas for right and left claustrum, linearly registered into subject space (used to crop the input image around claustrum)
  • seg.rh.stats, seg.lh.stats: files with right and left claustrum volumes (mm3)
  • synthmorph: folder with synthmorph registration to MNI152 space (nonlinear if using --qc, linear otherwise)
  • QCscore.max.dice.rh.dat, QCscore.max.dice.lh.dat: files with quality control scores for right and left hemispheres (if using --qc)

Content of this repository

  • mri_claustrum_seg: C shell script for segmenting claustrum
  • atlas: folder containing the claustrum probabilistic prior in MNI152 space (used to crop the input image around claustrum), and the high-resolution manual labels warped in MNI space (used to perform quality control)
  • model: folder containing the trained model and the python script for applying the model to a cropped input image

Training code

The training code can be downloaded from the SynthSeg repository

Contact

For any questions or comments, please raise an issue or contact cmauri@mgh.harvard.edu

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages