Bids-filter-file ignored when trying to select a specific T1w image

Hi all,
I want to use a T1w image preprocessed by QSIprep as an input T1w image for fmriprep, so that the derivatives of the two pipelines end up in the same space. I am trying to add the preprocessed T1w image as an additional acquisition in the input anat folder (so that my anat folder has two niftis: sub-xxx_ses-1_acq-qsiprep_T1w.nii.gz, sub-xxx_ses-1_acq-original_T1w.nii.gz). Then I am trying to use a bids-filter-file to select the acq-qsiprep one. My file looks like this:

{
“t1w”: {
“datatype”: “anat”,
“acquisition”: “qsiprep”,
“suffix”: “T1w”
}
}

The pipeline runs without any error but seems to ignore this file (I saw that this issue was previously raised here and here: --bids-filter-file seems not working as supposed · Issue #2368 · nipreps/fmriprep · GitHub ).

1- Is there a syntax error in my filter file? is there a documentation or example that i can follow to make sure I’m filtering properly?

2- My html log says that 2 T1w images were detected in the BIDS folder, but it’s unclear from the documentation which of them was used as the T1w reference for coregistration. After playing around and checking the output, it seems to me that fmriprep chooses the first T1w in the anat folder in an alphabetical order? meaning, when I had ‘acq-qsiprep’ compared with ‘acq-original’, the preprocessed functionals ended up in the same space as acq-original. But when I renamed ‘acq-original’ to ‘acq-z’,my derivatives ended up in the same space as ‘acq-qsiprep’… Can someone confirm if that’s the case?

Thanks in advance,
Maya

Different method than what you are proposing and would require a step after the two “prep” pipelines finish, but a rigid transformation in ANTs between the dwiref and boldref files created a transformation resulting in good alignment (look at the video in the linked post). I can provide a short script to do that if you’re interested (just send me a message with your email).

Best,
Steven

Thanks! That would be really helpful and sounds less messy too! So just to make sure I get this right, my pipeline would consist of
1- running fmriprep and qsiprep separately as I normally would
2- running a script to do antsRegistration between the preprocessed t1w boldref and t1w dwiref
3- running a script to apply the transformation calculated in (2) on the BOLD data, using antsApplyTransforms
Is that correct?

Yup! I’m almost done drafting a small script that uses antspy (python ANTs) to do steps 2 and 3, and can send it when done if you’d like.