fMRIPrep - Creating functional masks from partial slabs

Hi there,

We recently acquired whole-brain anatomical images (T1+T2) but for the functionals, we acquired only a slab over the primary somatosensory cortex. We noticed that some functional/BOLD masks (mainly in MNI space) are covering skull/other brain structures, although the coregistration seemed to work fine (the anatomical is well aligned to the functional slab).

How could we restrict BOLD masks to GM?
Or isn’t fMRIPrep able to run partial slabs?
Has someone run over this problem? Any suggestions?

Any information on this would be helpful! Thanks!

Anatomical mask - MNI:

Functional mask - MNI:

In fmriprep, the functional mask is calculated directly from the functional reference image, and the anatomical mask is calculated directly from the anatomical image.
The good news in your case is that the functional image is well coregistered to the anatomical image (I believe your word on this, it is hard to see from these screenshots).
What you could try would be to resample the anatomical mask into your functional resolution and field-of-view (obviously when the anatomical images and the functional images are in the same space, i.e MNI or T1w space). You could do that with FSLeyes for instance (Tools > Resample Image ).