@@ -51,6 +51,8 @@ def init_unwarp_wf(*, free_mem=None, omp_nthreads=1, debug=False, name="unwarp_w
51
51
------
52
52
distorted
53
53
the target EPI image.
54
+ distorted_ref
55
+ the distorted reference EPI image to which each volume has been motion corrected
54
56
metadata
55
57
dictionary of metadata corresponding to the target EPI image
56
58
fmap_coeff
@@ -72,6 +74,16 @@ def init_unwarp_wf(*, free_mem=None, omp_nthreads=1, debug=False, name="unwarp_w
72
74
the target EPI reference image, after applying unwarping.
73
75
corrected_mask
74
76
a fast mask calculated from the corrected EPI reference.
77
+ fieldmap_ref
78
+ the actual B\ :sub:`0` inhomogeneity map (also called *fieldmap*)
79
+ interpolated from the B-Spline coefficients into the reference EPI's
80
+ grid, given in Hz units.
81
+ No motion is taken into account.
82
+ fieldwarp_ref
83
+ the displacements field interpolated from the B-Spline coefficients
84
+ and scaled by the appropriate parameters (readout time of the EPI
85
+ target and voxel size along PE).
86
+ No motion is taken into account.
75
87
76
88
"""
77
89
from niworkflows .interfaces .images import RobustAverage
@@ -84,7 +96,7 @@ def init_unwarp_wf(*, free_mem=None, omp_nthreads=1, debug=False, name="unwarp_w
84
96
workflow = Workflow (name = name )
85
97
inputnode = pe .Node (
86
98
niu .IdentityInterface (
87
- fields = ["distorted" , "metadata" , "fmap_coeff" , "hmc_xforms" ]
99
+ fields = ["distorted" , "distorted_ref" , " metadata" , "fmap_coeff" , "hmc_xforms" ]
88
100
),
89
101
name = "inputnode" ,
90
102
)
@@ -96,6 +108,8 @@ def init_unwarp_wf(*, free_mem=None, omp_nthreads=1, debug=False, name="unwarp_w
96
108
"corrected" ,
97
109
"corrected_ref" ,
98
110
"corrected_mask" ,
111
+ "fieldwarp_ref" ,
112
+ "fieldmap_ref" ,
99
113
]
100
114
),
101
115
name = "outputnode" ,
@@ -121,6 +135,8 @@ def init_unwarp_wf(*, free_mem=None, omp_nthreads=1, debug=False, name="unwarp_w
121
135
name = "resample" ,
122
136
)
123
137
138
+ resample_ref = pe .Node (ApplyCoeffsField (), mem_gb = mem_per_thread , name = "resample_ref" )
139
+
124
140
merge = pe .Node (MergeSeries (), name = "merge" )
125
141
average = pe .Node (RobustAverage (mc_method = None ), name = "average" )
126
142
@@ -135,12 +151,18 @@ def init_unwarp_wf(*, free_mem=None, omp_nthreads=1, debug=False, name="unwarp_w
135
151
("hmc_xforms" , "in_xfms" )]),
136
152
(rotime , resample , [("readout_time" , "ro_time" ),
137
153
("pe_direction" , "pe_dir" )]),
154
+ (inputnode , resample_ref , [("distorted_ref" , "in_data" ),
155
+ ("fmap_coeff" , "in_coeff" )]),
156
+ (rotime , resample_ref , [("readout_time" , "ro_time" ),
157
+ ("pe_direction" , "pe_dir" )]),
138
158
(resample , merge , [("out_corrected" , "in_files" )]),
139
159
(merge , average , [("out_file" , "in_file" )]),
140
160
(average , brainextraction_wf , [("out_file" , "inputnode.in_file" )]),
141
161
(merge , outputnode , [("out_file" , "corrected" )]),
142
162
(resample , outputnode , [("out_field" , "fieldmap" ),
143
163
("out_warp" , "fieldwarp" )]),
164
+ (resample_ref , outputnode , [("out_field" , "fieldmap_ref" ),
165
+ ("out_warp" , "fieldwarp_ref" )]),
144
166
(brainextraction_wf , outputnode , [
145
167
("outputnode.out_file" , "corrected_ref" ),
146
168
("outputnode.out_mask" , "corrected_mask" ),
0 commit comments