Skip to content

Commit

Permalink
RF: Merge corrected references, if multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Aug 9, 2023
1 parent 082b640 commit 8b385a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sdcflows/workflows/apply/correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def init_unwarp_wf(
No motion is taken into account.
"""
from niworkflows.interfaces.images import RobustAverage
from niworkflows.interfaces.nibabel import MergeSeries
from sdcflows.interfaces.epi import GetReadoutTime
from sdcflows.interfaces.bspline import ApplyCoeffsField
Expand Down Expand Up @@ -140,6 +141,9 @@ def init_unwarp_wf(
ApplyCoeffsField(), mem_gb=mem_per_thread, name="resample_ref"
)

merge_ref = pe.Node(MergeSeries(), name="merge")
average = pe.Node(RobustAverage(mc_method=None), name="average")

brainextraction_wf = init_brainextraction_wf()

# fmt:off
Expand All @@ -156,7 +160,9 @@ def init_unwarp_wf(
("readout_time", "ro_time"),
("pe_direction", "pe_dir"),
]),
(resample_ref, brainextraction_wf, [("out_corrected", "inputnode.in_file")]),
(resample_ref, merge_ref, [("out_corrected", "in_files")]),
(merge_ref, average, [("out_file", "in_file")]),
(average, brainextraction_wf, [("out_file", "inputnode.in_file")]),
(resample_ref, outputnode, [
("out_field", "fieldmap_ref"),
("out_warp", "fieldwarp_ref"),
Expand Down

0 comments on commit 8b385a9

Please sign in to comment.