Using my own brainmask

Hi, I have a file that i want to use as a mask to skull strip an image. I added this line:

--skull-strip-template /mnt/DATA/Trajectories_Data/Brain/rs_data_fmriprep_input/sub-regtrj040/anat/skullstrip_template/sub-regtrj040_T1w.nii

and received this error:

fmriprep: error: argument --skull-strip-template: invalid from_string value: '/mnt/DATA/Trajectories_Data/Brain/rs_data_fmriprep_input/sub-regtrj040/anat/skullstrip_template/sub-regtrj040_T1w.nii'

can you let me know if the syntax is correct?


Injecting a brainmask is not yet supported (I think…). The --skull-strip-template is a means for specifying a template image that includes both a registration target and a brainmask, and will generally be a template you can find in TemplateFlow.

It may be possible to hack this to provide your original image as the registration target by creating a fake template with your subject data, but I’ve never tried it. It seems likely to be a bit fraught, but interesting to try. Out of curiosity, does the ANTs brain extraction not work for your data, or is the idea to save time because you’ve precomputed?

In the future, we’re going to be making an effort to permit precomputed derivatives to be provided as alternative inputs. If you’re interested in helping get this feature in, we’re always glad to help contributors get going.

Got it. Thank you for your help!