antsBrainExtraction failure? Freesurfer does fine


I ran fmriprep with the command below.

singularity run --cleanenv -B ${BIDS_folder}:/mnt ${tools_dir}/fmriprep-1.2.6-1.simg \
/mnt/ /mnt/derivatives \
participant \
-w /tmp/utooley${subject} \
--participant-label ${subject} \
--fs-license-file $HOME/license.txt \
--use-aroma \
--output-space T1w template fsaverage5 \
--cifti-output \
--nthreads 1 \

The brain mask in my fmriprep freesurfer folder looks like it’s much too stringent, assuming because it used ANTs, screenshots from the .html report below.

Freesurfer brain mask seems to be much better. Attached are the same subject from FMRIPREP’s SUBJECTS_DIR and vanilla Freesurfer’s SUBJECTS_DIR, illustrating the issue. I hadn’t seen this before but now I’m worrying about brain extraction with ANTs–it looks like the option to use any other methods has been disabled?

If I copy the vanilla-Freesurfer-run subject into the FMRIPREP freesurfer directory and rerun FMRIPREP, will the Freesurfer brain mask be used?


It looks to me like an infant’s image. Is that correct?

Unfortunately, what you suggest is not possible at this moment. However, we have plans for integrating pediatric templates that would probably work much better with your images.


Thanks so much for the response! But no dice–it’s a 6 year old. We use Freesurfer tools with kids and if the T1 is okay, brain extraction generally works all right (but needs checking, hence the attention here).

Pediatric templates would of course be great, though!

1 Like

Do you use pediatric templates? Would you recommend one?


One more question @Ursula_Tooley : do you have the age encoded in the participants.tsv file of your BIDS dataset?



I’m not sure if anyone has given recommendations for possible pediatric templates in other discussions, but the Fonov/ICBM templates ( would be a logical option. Like the adult template used in fmriprep, they have assymetrical versions and were also produced by McConnell Brain Imaging Center. They also have a 4.5 - 18.5 year old template, which would be able to meet the needs of many people looking to use fmriprep on pediatric datasets. I’m also very interested in this option being available.


1 Like

fMRIPrep will eventually support any template included in TemplateFlow. Some templates that will be added in the near future are listed here -

One of them is the Pediatric template from BIC.


Sorry for such a long wait, @oesteban–I was working on a different project more urgently than this one! We don’t use pediatric templates, typically, just regular ol’ freesurfer, and then lots of quality checks. My PI has said (but I’ve never personally quantitatively or qualitatively examined) that her experience has been that they don’t buy you a ton, but I am aware of the Fonov templates.

We don’t have age encoded in the participants.tsv file–it looks like that gets calculated from the DOB input at the scanner, and for deidentifiability reasons we don’t input the real participant DOB. Does that affect anything in the ppc-ing pipeline? Or were you asking because that could be one way to feed in a pediatric template and you wanted me to test?

I’ve seen a few threads here since about the skull-stripping being overly stringent/having issues…are there updates to fmriprep that might help? Should I pull a new image and try this person again?


Also, as an update–I fixed this by running freesurfer separately from FMRIPREP, giving it a ton more memory, which resulted in a good-looking segmentation. Then fed the pre-run Freesurfer directory into FMRIPREP. It looks like the FS run within FMRIPREP didn’t do as a good a job, which propagated downstream errors. No idea why that might be!