Skull stripped nii.gz fMRIPREP

Hey all,
my software engineer and I are working on some fMRIPREP to FEAT work flows, and we are having issues finding the skull stripped BOLD images.

The (example) sub-001_task-resting_bold_space-T1w_preproc.nii.gz seems to unskull stripped… but looking at the fmriprep docs, it is clearly doing a lot of epi skull stripping.

I have found a skull stripped image in the folder
however, it looks like it only has a single volume…

Am I missing something? Or does fMRIPREP not produce a motion corrected and skull stripped BOLD nifti?

cc. @nikkibytes

1 Like

FMRIPREP does not produce motion corrected and skull stripped BOLD nifties. Instead it produces:

  • bold_space-<space>_brainmask.nii.gz Brain mask for EPI files, calculated by nilearn on the average EPI volume, post-motion correction. 3D nifti
  • bold_space-<space>_preproc.nii.gz Motion-corrected (using MCFLIRT for estimation and ANTs for interpolation) EPI file. 4D nifti

More at

The reason behind this decision is that not everyone might want to use the run specific mask (instead a group level 80% coverage mask or MNI grey matter mask might be preferred). Would love to hear what you think.

Ah! Ok, yes I have both those output, so I am not missing anything.

I think it would be useful have a flag that allows you to save the bet output. Or since it appears a lot of work is used to develop the mask, an option to mask out the skull at the individual level?

I am thinking from a practical perspective of:
raw data -> bidsified->fMRIPREP->feat
with minimal additional steps

Or if you want to keep FMRIPREP lean, a FEATPREP plug in would be interesting… Could parse the confound.tsv file for easy integration into feat (additional confound evs, motion correction parameters, etc). Then one would only need to build their model matrix since fmriprep already registers the T1 and BOLD, skullstrips, motion corrects…

Thanks for the quick reply!

So FEAT does not allow users to provide a mask? Data needs to be masked beforehand?

We have been working on something like this. It’s not based on FEAT, but it fits GLMs and is developed to work well with FMRIPREP. Check it out (@effigies is the lead dev)

Hmmm, an interesting idea… I believe it does allow for masking in the “Post-Stats” tab.

My only concern would be in the registration tab. I haven’t examined it throughly, but will it error out if one gives flirt a non-skullstripped image and doesn’t have the BET check ‘on’? I know Jeanette has a lovely work around for alternate registration already on the back end, but it requires running flirt in FEAT.

I knew y’all had to be working on some GLM, though I maintain getting FEAT friendly evs for fd confounds and motion parameters would be nice :wink:

I’m not a FEAT expert, but I don’t see why FEAT would break if you give it unskullstripped data and disable coregistration and skullstripping.

I agree it would be good to have a tool that automates steps described by Jeanette that are necessary to prevent FEAT to work with inputs that are already in the right space. I don’t think that providing skullstripped inputs would change that.

BTW @oesteban - does the steps described in the above video are still necessary if one uses --template-resampling-grid 2mm or --template-resampling-grid /path/to/FSL/MNI/template?

I did a bit of testing, loaded in the unskullstripped preproc data hot off the fmriprep as my feat input and the brainmask in the post stats, turned off mcflirt, bet, registration. As expected there is no reg directory, so higher level feat analyses would fail. Interestingly, the skull still appears in my filtered_func data, mean_func, and stats images… I have never tried to threshold my first level stats (more of a group level gal), so I might be missing something, but to me it appears that loading in a mask at the post stats is not equivalent to skull stripping.

1 Like

Yes, that is correct.

Interesting, thanks for sharing!

1 Like

I was recently looking into the very same issue and came across the following post on the FSL listserv:


Very interesting. So it appears FEAT really does either require a skull stripped brain or to BET within the program. Thanks for the find!


@Steve_Wilson would you be interested in sending a PR to FMRIPREP’s documentation adding a note on this where the outputs are described?

Hi @oesteban - can you say a bit more about what that would involve? I’d be happy to help, just want to be sure I would know what I’m doing!