Bids filter file to use synthstripped T1 with sMRIPrep

Hi all,

Since many of my cases have issues when processed with the skull stripping method built into sMRIPrep, I would like to use SynthStrip skull-stripped T1 images with as the input for sMRIPrep (version 0.12.1). I modified my sMRIPrep singularity call to include --skull-strip-mode skip.

My issue is that I am having trouble with the bids filter file. I want the filter file to recognize the SynthStrip image and not the raw image. I get the error:
ValueError: 'rec' is not a recognized entity. If you're sure you want to impose this constraint, set invalid_filters='allow'.

This is what my bids filter file looks like:
{
“t1w”: {
“datatype”: “anat”,
“suffix”: “T1w”,
“rec”: “synthstrip”
}
}

Bids documentation as well as another Neurostars post mentioned using “rec-”.
I also tried "suffix": "T1w_rec-synthstrip but that didn’t work either.

My bids file structure looks like this:
sub-#
ses-#
anat
sub-#_ses-#_T1w.nii.gz
sub-#_ses-#_T1w.json
sub-#_ses-#_T1w_rec-synthstrip.nii.gz

I would appreciate any help on this! Thank you so much.

Margo

The entity name is “reconstruction”.

1 Like

Thank you so much for your reply @effigies !
I updated my bids-filter-file:

{
    "t1w": {
        "datatype": "anat",
        "suffix": "T1w",
        "reconstruction": "synthstrip"
    }
}

Unfortunately I get another error now:
Exception: No T1w images found for participant #####. All workflows require T1w images.

Hi @mkersey,

You have your synthstrip file named wrong. The rec-<> label has to go before the T1w suffix.

Best,
Steven

1 Like

Thank you @Steven ! This fix in combination with @effigies was the solution!