fMRIPrep - Poorly Aligned bold2anat Registration

Summary of what happened:

Hi all,
I am having an issue with the automatic bold-to-T1 registration coming out fairly significantly misaligned for the functional data that I am trying to analyze. This is causing some downstream issues with group analysis, so I’m looking for a solution that is reasonable for a large dataset.

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

inputdir=/project/oathes_analysis2/R61/bids
outputdir=/project/oathes_analysis2/R61/fmriprep/prerun_output/$1
singularity run --cleanenv \
  --no-home \
  -B ${jobTmpDir}:/tmp \
  -B "/project/oathes_analysis2/templateflow:/templateflow" \
  -B "/appl/freesurfer-7.1.1:/freesurfer" \
  -B ${inputdir}:/data/input \
  -B ${outputdir}:/data/output \
  -B /project/oathes_analysis2/R61/fmriprep/prerun_output/$1:/fssubdir \
  -B /project/oathes_analysis2/R61:/basepath \
/project/oathes_analysis2/singularity_containers/fmriprep-23.2.3.simg \
/data/input /data/output participant --skull-strip-template OASIS30ANTs --fs-license-file /freesurfer/license.txt \
--bids-filter-file /basepath/bids_filter_file_tmsfmri.json \
--fs-subjects-dir /fssubdir/sourcedata/freesurfer \
--output-spaces T1w MNI152NLin6Asym:res-2 \
--bold2t1w-dof 6 \
--dvars-spike-threshold 1.5 \
--fd-spike-threshold 0.5 \
--ignore slicetiming \
--notrack --nthreads 16 --omp-nthreads 15 --work-dir ${SINGULARITYENV_TMPDIR} --verbose --participant-label $1

Version:

fmriprep-23.2.3

Environment (Docker, Singularity / Apptainer, custom installation):

Singularity/Apptainer

Screenshots / relevant information:

We are using a reverse phase encode direction image (dir-PA_epi) for fieldmap correction, using the “IntendedFor” json field.

This image shows the “original” BOLD image before any T1 alignment, and as you can see it’s pretty far from the T1’s FOV, but not terribly crooked or rotated, so I expected the registration to turn out better than it has.


Any recommendations are very welcome. I’ve read through many other posts and tried alternative options with the --force_no_bbr and --bold2t1w-dof flags in the fmriprep call, with no change.


Hi @jdickson14,

Does this behavior persist on the most recent version?

Best,
Steven

Hi Steven,
This is an ongoing project, and the baseline images are being processed using fmriprep v23.2.3. We would prefer to maintain the same version if possible. The 23.2.3 singularity image is hosted on a computing cluster, but I am trying to create a local install of fmriprep with the most recent stable release to rerun. Is there anything else that I can try in the meantime?
Thanks,
Jess

I would try changing the origin on the bids bold images so there is better overlap between the “original” bold and T1w image. I’m not sure if that will help at all but it is worth a shot.

Hi again Steven,
I was able to access an updated Singularity image for fmriprep v25.0.0 to try and rerun this and got the same result with a poorly aligned bold-to-anat registration.
However, my PI tried running fmriprep v25.0.0 on this subject via docker on his local machine, and got a successfully registered outcome.
All of the flags and settings that we used are the same, verified by checking the .toml log. The only difference is that my runs have used a pre-run FreeSurfer output which is bound in the singularity call, while his involved a fresh recon-all run.
Any ideas why this would be the case?

Here is my singularity fmriprep v25.0.0 run (identical to 23.2.3)

vs. his docker fmriprep v25.0.0 run

Could be a poor FS run from before. I’m not sure you mentioned where it originally come from, so at this point can’t say too much.

Also I know you mentioned this is an ongoing project, so perhaps you can switch to 25.2.2 which the most recent version in a dedicated long-term support branch.

Best,
Steven