anatomical_segmentation
Subworkflow performing anatomical segmentation to produce WM, GM and CSF maps/masks. It handles two type of input channels, either an anatomical image (most likely T1) and/or freesurfer parcellations files. Depending on which channel is provided, the subworkflow will perform either of the following:
1) Channel with an anatomical image with run_synthseg parameter will result in using Freesurfer synthseg producing WM, GM
and CSF masks/maps.
2) Channel with an anatomical image will result in using FSL’s fast segmentation producing WM, GM,
and CSF masks/maps.
3) Channel with FreeSurfer’s parcellations files will result in using Scilpy’s tools to produce
WM, GM, and CSF masks. Probability maps will be produced by FSLFast. Typical next steps after this subworkflow would be to combine the resulting masks/maps with fODF data to perform TRACKING.
Keywords : Anatomical, Segmentation, Maps, Masks
Components : segmentation/fastseg, segmentation/freesurferseg, segmentation/synthseg, utils_options
Inputs
Section titled “Inputs”| Type | Description | Mandatory | Pattern | |
|---|---|---|---|---|
| ch_image | file | The input channel containing the anatomical images (typically T1s). If provided, the subworkflow will perform segmentation using FSL’s fast. Structure : tuple val(meta), path(image)
| True | *.\{nii,nii.gz\} |
| ch_freesurferseg | file | The input channel containing freesurfer parcellations files (aparc+aseg and wm_parc parcellations). If provided, the subworkflow will use Scilpy’s tools to convert the parcellations into masks. Structure : tuple val(meta), path(aparc_aseg), path(wm_parc)
| False | *.mgz |
| ch_lesion | file | The input channel containing a lesion mask file to correct the white matter mask. The lesion mask must be a binary mask. Structure : tuple val(meta), path(lesion)
| False | *\{nii.nii.gz\} |
| ch_fs_license | file | The input channel containing the FreeSurfer license.To get one, go to https://surfer.nmr.mgh.harvard.edu/registration.html. Optional. If you have already set your license as prescribed by Freesurfer (copied to a .license file in your $FREESURFER_HOME), this is not required. Structure : tuple val(meta), path(fs_license)
| False | |
| options | map | Map of options for the subworkflow.
| True |
Outputs
Section titled “Outputs”| Type | Description | Mandatory | Pattern | |
|---|---|---|---|---|
| wm_mask | file | Channel containing WM mask files. Will be outputted regardless of the selected segmentation method and inputs provided. Structure : tuple val(meta), path(wm_mask)
| True | *.\{nii,nii.gz\} |
| gm_mask | file | Channel containing GM mask files. Will be outputted regardless of the selected segmentation method and inputs provided. Structure : tuple val(meta), path(gm_mask)
| True | *.\{nii,nii.gz\} |
| csf_mask | file | Channel containing CSF mask files. Will be outputted regardless of the selected segmentation method and inputs provided. Structure : tuple val(meta), path(csf_mask)
| True | *.\{nii,nii.gz\} |
| wm_map | file | Channel containing WM probability maps. Structure : tuple val(meta), path(wm_map)
| False | *.\{nii,nii.gz\} |
| gm_map | file | Channel containing GM probability maps. Structure : tuple val(meta), path(gm_map)
| False | *.\{nii,nii.gz\} |
| csf_map | file | Channel containing CSF probability maps. Structure : tuple val(meta), path(csf_map)
| False | *.\{nii,nii.gz\} |
| seg | file | Channel containing the optional nifti segmentation volume from synthseg. Structure : tuple val(meta), path(seg)
| False | *.\{nii,nii.gz\} |
| aparc_aseg | file | Channel containing the optional nifti cortical parcellation and segmentation volume from synthseg. Structure : tuple val(meta), path(aparc_aseg)
| False | *.\{nii,nii.gz\} |
| resample | file | Channel containing the optional resampled images at 1mm. Structure : tuple val(meta), path(resample)
| False | *.\{nii.nii.gz\} |
| volume | file | Channel containing the optional Output CSV file with volumes for all structures and subjects. Structure : tuple val(meta), path(volume)
| False | *.csv |
| qc_score | file | Channel containing the optional output CSV file with qc scores for all subjects. Structure : tuple val(meta), path(qc_score)
| False | *.csv |
| versions | file | File containing software versions. Structure : tuple path(versions)
| True | versions.yml |
Authors
Section titled “Authors”Last updated : 2026-03-17