Skip to content

Commit 375dd7a

Browse files
authored
Merge pull request #381 from effigies/enh/target2fmap
ENH: Output target2fmap_xfm from coeff2epi_wf
2 parents 5434c79 + b654f81 commit 375dd7a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

sdcflows/workflows/apply/registration.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ def init_coeff2epi_wf(
8787
target_ref
8888
the target reference EPI resampled into the fieldmap reference for
8989
quality control purposes.
90+
target2fmap_xfm
91+
An ITK-style transform produced with ANTs that can be used as transform in
92+
``antsApplyTransforms`` with the fieldmap as reference and the target EPI
93+
as moving, resampling the latter into the fieldmap space.
9094
9195
"""
9296
from packaging.version import parse as parseversion, Version
@@ -107,7 +111,8 @@ def init_coeff2epi_wf(
107111
name="inputnode",
108112
)
109113
outputnode = pe.Node(
110-
niu.IdentityInterface(fields=["target_ref", "fmap_coeff"]), name="outputnode"
114+
niu.IdentityInterface(fields=["target_ref", "fmap_coeff", "target2fmap_xfm"]),
115+
name="outputnode",
111116
)
112117

113118
# Register the reference of the fieldmap to the reference
@@ -133,14 +138,17 @@ def init_coeff2epi_wf(
133138
("target_mask", f"moving_image_mask{mask_trait_s}"),
134139
("fmap_mask", f"fixed_image_mask{mask_trait_s}"),
135140
]),
136-
(coregister, outputnode, [("warped_image", "target_ref")]),
141+
(coregister, outputnode, [
142+
("warped_image", "target_ref"),
143+
("forward_transforms", "target2fmap_xfm"),
144+
]),
137145
])
138146
# fmt: on
139147

140148
if not write_coeff:
141149
return workflow
142150

143-
# Map the coefficients into the EPI space
151+
# Resample the coefficients into the EPI grid
144152
map_coeff = pe.Node(TransformCoefficients(), name="map_coeff")
145153
map_coeff.interface._always_run = debug
146154

0 commit comments

Comments
 (0)