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.deface.deface(anat_file, outdir)[source]ΒΆ

Deface MRI head images using the FSL fsl_deface command.

The UK Biobank study uses a customized image processing pipeline based on FSL Alfaro-Almagro et al. (2018), which includes a de-facing approach also based on FSL tools. It was designed for use with T1w images. This de-facing approach was later extracted from the larger processing pipeline and released as part of the main FSL package as fsl_deface. Like mri_deface and pydeface, this method uses linear registration (also FLIRT) to locate its own pre-defined mask of face voxels on the target image, then sets voxels in the mask to zero. Unlike mri_deface and pydeface, this method also removes the ears. Although it is also relatively popular, we did not include mask_face Milchenko and Marcus (2013) because previous work has already demonstrated that it provides inadequate protection Abramian and Eklund (2019).

Parameters:

anat_file : str

input MRI T1w head image to be defaced: need to be named as *T1w.<ext>.

outdir : str

the output folder.

Returns:

defaced_anat_file : str

the defaced input MRI head image.

defaced_mask_file : str

the defacing binary mask.

References

Christopher G. Schwarz, Walter K. Kremers, Heather J. Wiste, Jeffrey L. Gunter, Prashanthi Vemuri, Anthony J. Spychalla, Kejal Kantarci, Aaron P. Schultz, Reisa A. Sperling, David S. Knopman, Ronald C. Petersen, Clifford R. Jack, Changing the face of neuroimaging research: Comparing a new MRI de-facing technique with popular alternatives, NeuroImage 2021.

Follow us

© 2025, brainprep developers