From 242e988aa1d903641708daca1072d4f6b9e0f8f6 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 17 Aug 2023 11:21:34 -0400 Subject: [PATCH 1/2] FIX: Use unwarp_wf directly on reference Disable now-deprecated write_coeffs --- fmriprep/workflows/bold/fit.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fmriprep/workflows/bold/fit.py b/fmriprep/workflows/bold/fit.py index bd0bce311..84733edc4 100644 --- a/fmriprep/workflows/bold/fit.py +++ b/fmriprep/workflows/bold/fit.py @@ -282,7 +282,6 @@ def init_bold_fit_wf( debug="fieldmaps" in config.execution.debug, omp_nthreads=config.nipype.omp_nthreads, sloppy=config.execution.sloppy, - write_coeff=True, ) unwarp_wf = init_unwarp_wf( free_mem=config.environment.free_mem, @@ -335,11 +334,10 @@ def init_bold_fit_wf( ("outputnode.fmap_coeff", "inputnode.fmap_coeff"), ]), (enhance_boldref_wf, unwarp_wf, [ - ('outputnode.bias_corrected_file', 'inputnode.distorted_ref'), ('outputnode.bias_corrected_file', 'inputnode.distorted'), ]), (unwarp_wf, ds_coreg_boldref_wf, [ - ('outputnode.corrected_ref', 'inputnode.boldref'), + ('outputnode.corrected', 'inputnode.boldref'), ]), (unwarp_wf, regref_buffer, [ ('outputnode.corrected_mask', 'boldmask'), From d9a0e3b85527fa17bf8df3b181b882eef698ff57 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 23 Aug 2023 11:31:13 -0400 Subject: [PATCH 2/2] FIX: Convert boldref2fmap transforms to ITK text format --- fmriprep/workflows/bold/fit.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fmriprep/workflows/bold/fit.py b/fmriprep/workflows/bold/fit.py index 84733edc4..6be2bf10a 100644 --- a/fmriprep/workflows/bold/fit.py +++ b/fmriprep/workflows/bold/fit.py @@ -38,6 +38,7 @@ from nipype.pipeline import engine as pe from niworkflows.func.util import init_enhance_and_skullstrip_bold_wf from niworkflows.interfaces.header import ValidateImage +from niworkflows.interfaces.nitransforms import ConcatenateXFMs from niworkflows.utils.connections import listify from sdcflows.workflows.apply.correction import init_unwarp_wf from sdcflows.workflows.apply.registration import init_coeff2epi_wf @@ -299,6 +300,8 @@ def init_bold_fit_wf( run_without_submitting=True, ) + itk_mat2txt = pe.Node(ConcatenateXFMs(out_fmt="itk"), name="itk_text") + ds_fmapreg_wf = init_ds_registration_wf( bids_root=layout.root, output_dir=config.execution.output_dir, @@ -322,7 +325,8 @@ def init_bold_fit_wf( ("fmap_coeff", "inputnode.fmap_coeff"), ("fmap_mask", "inputnode.fmap_mask"), ]), - (coeff2epi_wf, ds_fmapreg_wf, [('outputnode.target2fmap_xfm', 'inputnode.xform')]), + (coeff2epi_wf, itk_mat2txt, [('outputnode.target2fmap_xfm', 'in_xfms')]), + (itk_mat2txt, ds_fmapreg_wf, [('out_xfm', 'inputnode.xform')]), # XXX Incomplete (fmapref_buffer, ds_fmapreg_wf, [('out', 'inputnode.source_files')]), (ds_fmapreg_wf, fmapreg_buffer, [('outputnode.xform', 'boldref2fmap_xfm')]),