Using skip skull stripping in fmriprep - where to put skull-stripped T1 files

Summary of what happened:

Hello!
I have one subject where skull stripping doesn’t seem to be as clean as I would like it to be (see below image).

Command used (and if a helper script was used, a link to the helper script or the command generated):

Version:

21.0.1

Environment (Docker, Singularity, custom installation):

Docker

Data formatted according to a validatable standard? Please provide the output of the validator:

Relevant log outputs (up to 20 lines):

fmriprep completes without any errors

Screenshots / relevant information:

fmriprep completes without any errors but the reconstruction looks like:
image

I skull stripped via the FSL GUI using BET brain extraction and when I view that skull-stripped image it looks like this:
image
(so it looks like the fmriprep reconstructed image)
And then I run another brain extraction on that 1st round of BET extraction and it’s cleaned up (below I took a screenshot of the 2nd extracted brain in blue overlaying the first extracted brain).

image

So, I think I would like to use this second pre-skullstripped T1 image but I’m not sure where/which folder to put this image into so that fmriprep knows to use it. Any insight/suggestions would be helpful! Let me know if I can provide clarifying information.

Thank you!

edit: Oh, if it’s important, this is a brain that has lesions so I’ve included the lesion_roi.nii.gz image in their Nifti/anat folder along with their T1w, T2w, and FLAIR images.

I’ve used 21.0.1 to run all other subjects so I’m wary and would like to avoid using the latest version on just one subject, but would welcome thoughts on this too if it’s the only solution.

Hi @fareshte,

I have reformatted your post to include the Software Support post template. In future posts, please use this template. There is some information that is missing from your post, such as BIDS validation and your code. Knowing this may help us debug.

You can put these images in your anat folder (perhaps using the rec-XX label to indicate already skull stripped) and use the fmriprep option to skip skull stripping if you are happy with it (--skull-strip-t1w skip). Just make sure you use something like a BIDS filter file to tell fmriprep to only use the skull stripped images.

Best,
Steven

Thank you, Steven!
Apologies for missing the template info. The data was formatted according to a validatable standard. I’m not sure where to find the output of the validator though to include here.

And I used the following to run fmriprep:

screen docker run -ti  \
    -v /Users/neurouser1/Documents/MSFatigue/Nifti/bids_directory/:/data \
    -v /Users/neurouser1/Documents/MSFatigue/xcp/fmriprep_out/:/out \
    -v /Users/neurouser1/Documents/fs_files/:/license \
    -v /Users/neurouser1/Documents/MSFatigue/scratch:/scratch \
    nipreps/fmriprep:21.0.1 \
    /data/ \
    /out/ \
    participant \
    --output-spaces fsaverage T1w MNI152NLin6Asym \
    --cifti-output 91k \
    --participant_label sub-004 \
    --fs-license-file /license/license.txt \
    --n_cpus '12' \
    --omp-nthreads 8 \
    --mem 250GB \
    --work-dir /scratch \
    --resource-monitor

I am new to this so I also apologize for the following questions -
Could you link me to the documentation on what the rec-XX label should be? I’ve tried looking and am not able to find it yet. Similarly, with BIDS filter file, I’m reading through the documentation (FAQ - Frequently Asked Questions — fmriprep version documentation) and to confirm, I should add the --bids-filter-file flag in my command? Would you be able to give an example of what the input should look like?

Thank you for your time!

Hi @fareshte

BIDS validation should be the first thing fmriprep does, and the validation report should be at the top of your output log.

It can be something like rec-skullstrip. As noted in the specification, the filename must be something like:

sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_ce-<label>][_rec-<label>][_dir-<label>][_run-<index>][_echo-<index>][_part-<mag|phase|real|imag>]_bold.nii[.gz]/json

You won’t need all the labels, but the order of the ones you do choose must abide by that.

Yes it would be part of your command, and the argument for that flag should link to a filter file you make. This part of documentation should be helpful..

Some other things:

Typically the output for these pipelines should go to $BIDSROOT/derivatives

I doubt you will need that much memory.

Best,
Steven