fMRIPrep: clarification on bold reference handling and resampling

Dear experts,

I am trying to better understand the resampling step and how fMRIPrep handles the use of different BOLD references in the case of having single-band refrence scans (SBRef). I am using fMRIPrep to preprocess multiband BOLD data, and my dataset includes one single-band reference acquisition per run. Based on the documentation, I understand the following regarding the definition of BOLD references and resampling:

  1. For head motion correction (HMC) estimation, the BOLD reference volume is derived from the BOLD timeseries.
  2. For susceptibility distortion correction (SDC) and coregistration steps, the SBRef is used as the BOLD reference if found in the input dataset.
  3. fMRIPrep computes transformations for head-motion estimation, SDC, and EPI to T1w registration using these reference scans.
  4. In the resampling of the BOLD runs onto standard spaces, these transformations are concatenated to avoid interpolation artifacts.

First question: alignment between bold references

Given that the SBRef is assumed to be acquired at the beginning of the run and is used for coregistration (after some preprocessing) and SDC, while the BOLD reference used for motion correction is the median volume of a subset of volumes from the timeseries, are the BOLD references explicitly aligned at any point in the pipeline (is the SBRef aligned to the middle volume of the BOLD timeseries to ensure consistency during the resampling)? If not, could you explain why?

Second question: identifying bold reference sources in the outputs

I wanted to find in the outputs which bold reference is used for each step. I noticed in my log output that the SBRef is correctly recognized in my BIDS dataset:

241209-07:48:39,657 nipype.workflow INFO:
	 Using single-band reference file(s) sub-DMF1315_ses-01_task-threat_sbref.nii.
2024-12-09 07:48:39,657 [    INFO] Using single-band reference file(s) sub-DMF1315_ses-01_task-threat_sbref.nii.
241209-07:48:39,737 nipype.workflow INFO:
	 Stage 1: Adding HMC boldref workflow
2024-12-09 07:48:39,737 [    INFO] Stage 1: Adding HMC boldref workflow
241209-07:48:39,746 nipype.workflow INFO:
	 Stage 2: Adding motion correction workflow
2024-12-09 07:48:39,746 [    INFO] Stage 2: Adding motion correction workflow
241209-07:48:39,756 nipype.workflow INFO:
	 Stage 3: Adding coregistration boldref workflow
2024-12-09 07:48:39,756 [    INFO] Stage 3: Adding coregistration boldref workflow

However, when I check the JSON file for the coregistration BOLD reference (sub-DMF1315_ses-01_task-threat_desc-coreg_boldref.json), the Sources field points to the BOLD reference used for HMC rather than the SBRef:

{
  "Sources": [
    "bids::sub-DMF1315/ses-01/func/sub-DMF1315_ses-01_task-threat_desc-hmc_boldref.nii.gz"
  ]
}

I was expecting the SBRef file to be listed here instead. Could you clarify why this is the case?

Command used:

singularity run --cleanenv --bind ${BIDS_DIR}:/data:ro,${OUTPUT_DIR}:/out,${WORK_DIR}:/work,${FS_LICENSE}:/license, ${SIF_PATH} \
    /data /out participant --participant-label $subj \
    --work-dir /work --fs-license-file /license \
    --output-spaces MNI152NLin2009cAsym:res-native T1w fsaverage6 fsLR:den-91k \
    --cifti-output 91k \
    --ignore slicetiming \
    --write-graph 

Version:

fMRIPrep 24.1.1

Environment:

Singularity/Apptainer

I would appreciate greatly if you could clarify these points to me in case I misunderstood the process.

Thank you very much for your time!

MarĂ­a