From 42e66fa13f2ef255df8a9545f96015896f4888c3 Mon Sep 17 00:00:00 2001 From: Logan Bennett Date: Sat, 25 Apr 2026 14:24:54 -0700 Subject: [PATCH 1/2] FIX: Remove redundant fmap_boldref resample in fmapCoreg report The 'fieldmap' input to init_func_fit_reports_wf is supplied by boldref_fmap (fit.py:500), which already reconstructs the fieldmap onto the BOLD reference grid. The fmap_boldref ApplyTransforms node added in gh-3387 was correct at the time but became redundant after gh-3467 rewired the input to come from boldref_fmap. The redundant resample applies boldref2fmap_xfm (inverted) to data already in BOLD space, shifting the fieldmap overlay in desc-fmapCoreg_bold.svg by ||boldref2fmap_xfm||. For acquisitions where BOLD and fieldmap have similar FOV anchors, the visible shift is within the brain and the figure looks fine; for acquisitions with substantially different FOV anchors (e.g. fieldmap reusing functional prescription with slice thickness/spacing decoupled), the overlay can render entirely outside the brain. The actual SDC correction is unaffected: unwarp_boldref (fit.py:614) and the time-series resample in apply.py both use ReconstructFieldmap outputs directly without going through fmap_boldref. --- fmriprep/workflows/bold/outputs.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/fmriprep/workflows/bold/outputs.py b/fmriprep/workflows/bold/outputs.py index df8de999c..8eae813cd 100644 --- a/fmriprep/workflows/bold/outputs.py +++ b/fmriprep/workflows/bold/outputs.py @@ -313,18 +313,6 @@ def init_func_fit_reports_wf( mem_gb=1, ) - fmap_boldref = pe.Node( - ApplyTransforms( - dimension=3, - default_value=0, - float=True, - invert_transform_flags=[True], - interpolation='LanczosWindowedSinc', - ), - name='fmap_boldref', - mem_gb=1, - ) - # SDC1 sdcreg_report = pe.Node( FieldmapReportlet( @@ -377,17 +365,12 @@ def init_func_fit_reports_wf( ('coreg_boldref', 'reference_image'), ('boldref2fmap_xfm', 'transforms'), ]), - (inputnode, fmap_boldref, [ - ('fieldmap', 'input_image'), - ('coreg_boldref', 'reference_image'), - ('boldref2fmap_xfm', 'transforms'), - ]), (inputnode, sdcreg_report, [ ('sdc_boldref', 'reference'), + ('fieldmap', 'fieldmap'), ('bold_mask', 'mask'), ]), (fmapref_boldref, sdcreg_report, [('output_image', 'moving')]), - (fmap_boldref, sdcreg_report, [('output_image', 'fieldmap')]), (sdcreg_report, ds_sdcreg_report, [('out_report', 'in_file')]), (inputnode, sdc_report, [ ('sdc_boldref', 'before'), From 8b7b3acb1cd7f7ad33f21b0457e8f4a85e47a209 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Wed, 13 May 2026 10:06:05 -0400 Subject: [PATCH 2/2] doc: Update inputs for init_func_fit_reports_wf --- fmriprep/workflows/bold/outputs.py | 36 ++++++++++++++++++------------ 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/fmriprep/workflows/bold/outputs.py b/fmriprep/workflows/bold/outputs.py index 8eae813cd..f8c9ebbb3 100644 --- a/fmriprep/workflows/bold/outputs.py +++ b/fmriprep/workflows/bold/outputs.py @@ -163,25 +163,33 @@ def init_func_fit_reports_wf( Inputs ------ - std_t1w - T1w image resampled to standard space - std_mask - Mask of skull-stripped template - subject_dir - FreeSurfer SUBJECTS_DIR - subject_id - FreeSurfer subject ID - t1w_conform_report - Conformation report + sdc_boldref + BOLD reference before SDC, in BOLD space + coreg_boldref + BOLD reference after SDC, in BOLD space + boldref2anat_xfm + Affine transform from BOLD reference to anatomical space + boldref2fmap_xfm + Affine transform from BOLD reference to fieldmap space t1w_preproc The T1w reference map, which is calculated as the average of bias-corrected and preprocessed T1w images, defining the anatomical space. - t1w_dseg - Segmentation in T1w space t1w_mask Brain (binary) mask estimated by brain extraction. - template - Template space and specifications + t1w_dseg + Segmentation in T1w space + fieldmap + Reconstructed fieldmap, in BOLD space + fmap_ref + Fieldmap reference image, in fieldmap space + subject_dir + FreeSurfer SUBJECTS_DIR + subject_id + FreeSurfer subject ID + summary_report + HTML snippet summarizing BOLD processing decisions + validation_report + HTML snippet indicating whether affine metadata were overwritten """ from nireports.interfaces.reporting.base import (