Skip to content

Commit

Permalink
Merge pull request #280 from nipreps/fix/average-epis-before-topup
Browse files Browse the repository at this point in the history
ENH: Calculate robust average of EPI inputs to TOPUP workflow
  • Loading branch information
oesteban authored Sep 3, 2022
2 parents 2b6c1cd + 0b7ecbd commit b1c2baf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdcflows/workflows/fit/pepolar.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def init_topup_wf(
)
outputnode.inputs.method = "PEB/PEPOLAR (phase-encoding based / PE-POLARity)"

epis_avg = pe.MapNode(RobustAverage(), name="epis_avg", iterfield="in_file")
flatten = pe.Node(Flatten(), name="flatten")
regrid = pe.Node(UniformGrid(reference=grid_reference), name="regrid")
concat_blips = pe.Node(MergeSeries(affine_tolerance=1e-4), name="concat_blips")
Expand Down Expand Up @@ -146,8 +147,9 @@ def init_topup_wf(

# fmt: off
workflow.connect([
(inputnode, flatten, [("in_data", "in_data"),
("metadata", "in_meta")]),
(inputnode, epis_avg, [("in_data", "in_file")]),
(inputnode, flatten, [("metadata", "in_meta")]),
(epis_avg, flatten, [("out_file", "in_data")]),
(flatten, readout_time, [("out_data", "in_file"),
("out_meta", "metadata")]),
(flatten, regrid, [("out_data", "in_data")]),
Expand Down

0 comments on commit b1c2baf

Please sign in to comment.