Issues with bbregister in fMRIPrep: Misaligned of functional-to-T1 images

Hello,

I am having trouble getting a good quality functional-to-T1w registration in fMRIPrep.

Summary of what happened:

I’m using fmriprep to preprocess BOLD images, and the bbregister outputs are not aligning the functional images well to the T1 images. The anatomical images seem to be tilted slightly more forwards compared to the functional images, and this issue is consistent across my dataset (though some are worse than others). I have tried disabling bbregister (using --force-no-bbr), but the issue seems to persist (the attached code and screenshots below show my original attempt using bbregister). This is a dataset of young kids (5-7 yr olds), so I don’t want to rely on --bold2anat-init header because there was likely some motion in between T1 and BOLD acquisitions.

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

unset PYTHONPATH;
SINGULARITY_TMPDIR=$CBICA_TMPDIR #make sure it mounts this as /tmp inside the container
export SINGULARITY_TMPDIR
echo $CBICA_TMPDIR
export SINGULARITYENV_OPENBLAS_NUM_THREADS=8;export SINGULARITYENV_OMP_NUM_THREADS=8;
singularity run --cleanenv -B ${SINGULARITY_TMPDIR}:/tmp ${tools_dir}/fmriprep-24.1.1.sif \
${BIDS_folder} ${BIDS_folder}/derivatives/fmriprep_24.1.1/fmriprep_t${ses:1} participant \
--participant-label ${sub} \
--fs-license-file $HOME/license.txt \
--fs-subjects-dir ${BIDS_folder}/derivatives/freesurfer_t${ses:1} \
--skull-strip-template MNIPediatricAsym:res-2:cohort-2 \
--output-spaces T1w func MNI152NLin2009cAsym:res-2 \
--ignore sbref \
--nthreads 8 \
-w /tmp --debug all \

Version:

24.1.1

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

Singularity

Relevant log outputs (up to 20 lines):

From fmriprep output log for one subject

Summary
	•	Original orientation: LAS
	•	Repetition time (TR): 2s
	•	Phase-encoding (PE) direction: Anterior-Posterior
	•	Single-echo EPI sequence.
	•	Slice timing correction: Applied
	•	Susceptibility distortion correction: None
	•	Registration: FreeSurfer bbregister (boundary-based registration, BBR) - 6 dof
	•	Non-steady-state volumes: 0

Thank you so much!



Hi @maayanziv,

It looks like you have session wise freesurfer data but are processing all anatomical data with fmriprep (which creates a subject average image from all sessions). Perhaps try BIDS filter files to only process the session’s anatomical data in fmriprep.

Also you shouldn’t need to specify session-wise output folders.

Best,
Steven

Thank you for your reply! If these subjects only have one session, will using BIDS filter files make a difference?

No, it wouldn’t make a difference in that case.

Also, I’m not seeing misalignment. In fact the alignment looks great. What I do see is likely signal dropout in the orbitofrontal lobe, affecting the final brain mask. Was susceptibility distortion performed on these data?

No, I unfortunately do not have fieldmaps for these data. Should I try running it with --use-syn-sdc warn?

It is worth trying for a few subjects, but don’t get your hopes up. I think SynBOLD-DisCo would be a better option. You can synthesize a fieldmap before re-running fmriprep.

Thanks, Steven! We originally thought our registration was failing because we are analyzing task data and our task vs. rest activation maps weren’t perfectly aligned with the edge of the brain, as expected. We thought this might be caused by the functional and anatomical brain masks not aligning perfectly. I’m now wondering if re-running fmriprep with synthesized fieldmaps may help this issue. I tried following the method you outlined here.

Do these fieldmap corrected outputs from fmriprep seem reasonable to you?
Thank you!



Hi @maayanziv,

Showing the boldref and t1 overlaid may be a better reference.

Best,
Steven

Hi Steven,

Thank you so much! Attached is the boldref overlaid on the T1 in MNI space for a subject after using the generated fieldmap. I’m also using --ignore sbref in fmriprep. Should I take that flag out?

Best,
Maayan


Hi @maayanziv,

The MNI outputs aren’t as useful, because those are non-linearly warped to the output space. The T1w space outputs, which should just use rigid alignment, would be a better gauge of bold-to-T1 alignment.

Best,
Steven

Hi Steven,

For some reason, when I pull up the boldref in T1 space, FSL doesn’t recognize it as being in the same space as the raw T1 image.

Best,
Maayan

Looks fine to me. Is this the same subject in the first post?

Yes! This is the same subject.

Hi @maayanziv,

In that case, I would say the second image looks better, with less dropout in orbitofrontal. This is with SynBOLD-DisCo? Or the --use-syn-sdc flag in fMRIPrep?

Best,
Steven

Hi Steven,

This is using SynBOLD-DisCo.

Thanks,
Maayan

Great! I’m happy that worked. It looks better than what I would expect the --use-syn-sdc fmriprep flag to have produced. Tagging @schillkg so he can see a successful SynBOLD use in fMRIPrep!

Best,
Steven