Skip to content

Commit

Permalink
FIX: Update connections to unwarp_wf, convert ITK transforms to text (#…
Browse files Browse the repository at this point in the history
…3077)

## Changes proposed in this pull request

* Accommodate nipreps/sdcflows#346
* Convert ITK transforms from `.mat` (MATLAB) to text format
  • Loading branch information
effigies authored Aug 23, 2023
2 parents 67edfec + d9a0e3b commit 7144371
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -282,7 +283,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,
Expand All @@ -300,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,
Expand All @@ -323,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')]),
Expand All @@ -335,11 +338,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'),
Expand Down

0 comments on commit 7144371

Please sign in to comment.