Menu

Package that provides tools for brain MRI Deep Learning pre-processing.

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the gallery for the big picture.

brainprep.cortical.recon_all_custom_wm_mask(fsdir, sid, wm)[source]

Assuming you have run recon-all (at least upto wm.mgz creation), this function allows to rerun recon-all using a custom white matter mask.

Parameters:

fsdir : str

the FreeSurfer working directory with all the subjects.

sid : str

the current subject identifier.

wm : str

path to the custom white matter mask. It has to be in the subject’s FreeSurfer space (1mm iso + aligned with brain.mgz) with values in [0, 1] (i.e. probability of being white matter). For example, it can be the ‘brain_pve_2.nii.gz” white matter probability map created by FSL Fast.

Returns:

subjfsdir : str

path to the resulting FreeSurfer segmentation.

Follow us

© 2025, brainprep developers