Fmriprep skull-strip functional data

I am just wanting to double check that my fmriprep has run correctly for my func data, I have found that my func output ‘sub-01_task-fogplank_run-2_space-MNI152NLin2009cAsym_desc-preproc_bold.nii’ is not skull-stripped, the.json file says “skull-stripped”-false, and I am not quite sure why this has occurred. Or whether I am supposed to then run a separate tool (ANTs brain extraction), to use the func brain mask to skull strip my func data. Is there something that I have missed in my fmriprep run, or does the func data not come out skull stripped normally?

Hi @NatashaLTaylor,

It is normal that the func output is not skull stripped, but there should be a brain mask file that is also in the derivatives folder that you can apply to your func output. Given the name of your func image, the brain mask file should be named: sub-01_task-fogplank_run-2_space-MNI152NLin2009cAsym_desc-brain_mask.nii.

Best,
James

2 Likes

Hi James,

Oh perfect! Thank you, just wanted to double check.
Also, thank you for consistently responding to my many questions with fmriprep. Finally got it all running correctly thanks to all your help.

Regards,
Natasha

Happy to help, if you have a question, chances are someone else also has that question, but doesn’t ask. The more (different) questions people ask and get answered, the more useful neurostars becomes and hopefully the easier it gets to do reproducible/open neuroscience! :slight_smile:

Best,
James

1 Like

To clarify, we need to apply the brain mask to the functional data before sending the functional data off for further analysis (in FSL FEAT, AFNI etc), correct?

Good question, In my experience, I usually pass the mask as an additional argument into whatever application I’m using. For example, when I use nistats (soon to be incorporated into nilearn), I pass the mask file as an additional argument into the FirstLevelModel class.

Here is another answer for a question about handling outputs from fmriprep

One more answer

The answers to those questions apply the mask output from fmriprep during their analyses, so you can take a look there to see further examples.

However, this is dependent on what workflow you are using, so I cannot speak broadly.

Does that help?
James

1 Like

Hi, I would like to clarify a point since I had the same question. (I am new to fmriprep and working with brain MRI images in general, so apologies for my ignorance.)

Some of the other question/answers you linked to have more complicated workflows which is not something I want to do, is there a way I can just apply the brain mask to the output and use the resulting skull-stripped image? And to do that I should download AFNI or FSL FEAT, there isn’t a way fmriprep does this? (I thought there would be since the html reports displayed the brain mask and then the skull stripped images.)

Hi @himaniyadav,

If you’re using fmriprep as a singularity or docker container you can use the FSL installation inside them.

For example, if I had an fmriprep singularity image named fmriprep.simg, I could use fslmaths to mask an image like so:

singularity exec fmriprep.simg fslmaths image_1.nii.gz -mas mask.nii.gz output_image.nii.gz

or if you were using docker you could do something like:

docker run --rm -it -v /path/to/fmriprep/folder:/data --entrypoint /bin/bash poldracklab/fmriprep -c 'fslmaths /data/image_1.nii.gz -mas /data/mask.nii.gz /data/output_image.nii.gz'

(I don’t have a fmriprep docker image readily available, so I cannot test the latter command to ensure it works).

Documentation for singularity exec (3.5)

Documentation for Docker (getting started)

Best,
James

Okay, I’m using docker. I’ll try it out and see if it works. Thanks for helping.