@@ -1105,7 +1105,8 @@ def create_reg_workflow(name='registration'):
1105
1105
'mean_image' ,
1106
1106
'anatomical_image' ,
1107
1107
'target_image' ,
1108
- 'target_image_brain' ]),
1108
+ 'target_image_brain' ,
1109
+ 'config_file' ]),
1109
1110
name = 'inputspec' )
1110
1111
outputnode = pe .Node (interface = util .IdentityInterface (fields = ['func2anat_transform' ,
1111
1112
'anat2target_transform' ,
@@ -1155,7 +1156,8 @@ def create_reg_workflow(name='registration'):
1155
1156
register .connect (inputnode , 'mean_image' , mean2anatbbr , 'in_file' )
1156
1157
register .connect (binarize , 'out_file' , mean2anatbbr , 'wm_seg' )
1157
1158
register .connect (inputnode , 'anatomical_image' , mean2anatbbr , 'reference' )
1158
- register .connect (mean2anat , 'out_matrix_file' , mean2anatbbr , 'in_matrix_file' )
1159
+ register .connect (mean2anat , 'out_matrix_file' ,
1160
+ mean2anatbbr , 'in_matrix_file' )
1159
1161
1160
1162
"""
1161
1163
Calculate affine transform from anatomical to target
@@ -1166,7 +1168,8 @@ def create_reg_workflow(name='registration'):
1166
1168
anat2target_affine .inputs .searchr_y = [- 180 , 180 ]
1167
1169
anat2target_affine .inputs .searchr_z = [- 180 , 180 ]
1168
1170
register .connect (stripper , 'out_file' , anat2target_affine , 'in_file' )
1169
- register .connect (inputnode , 'target_image_brain' , anat2target_affine , 'reference' )
1171
+ register .connect (inputnode , 'target_image_brain' ,
1172
+ anat2target_affine , 'reference' )
1170
1173
1171
1174
"""
1172
1175
Calculate nonlinear transform from anatomical to target
@@ -1177,21 +1180,20 @@ def create_reg_workflow(name='registration'):
1177
1180
register .connect (anat2target_affine , 'out_matrix_file' ,
1178
1181
anat2target_nonlinear , 'affine_file' )
1179
1182
anat2target_nonlinear .inputs .warp_resolution = (8 , 8 , 8 )
1180
- register .connect (inputnode , 'anatomical_image' , anat2target_nonlinear , 'in_file' )
1183
+ register .connect (inputnode , 'anatomical_image' ,
1184
+ anat2target_nonlinear , 'in_file' )
1185
+ register .connect (inputnode , 'config_file' ,
1186
+ anat2target_nonlinear , 'config_file' )
1181
1187
register .connect (inputnode , 'target_image' ,
1182
1188
anat2target_nonlinear , 'ref_file' )
1183
1189
1184
1190
"""
1185
1191
Transform the mean image. First to anatomical and then to target
1186
1192
"""
1187
1193
1188
- warp2anat = pe .Node (fsl .ApplyWarp (interp = 'spline' ), name = 'warp2anat' )
1189
- register .connect (inputnode , 'mean_image' , warp2anat , 'in_file' )
1190
- register .connect (inputnode , 'anatomical_image' , warp2anat , 'ref_file' )
1191
- register .connect (mean2anatbbr , 'out_matrix_file' , warp2anat , 'premat' )
1192
-
1193
- warpmean = warp2anat .clone (name = 'warpmean' )
1194
- register .connect (warp2anat , 'out_file' , warpmean , 'in_file' )
1194
+ warpmean = pe .Node (fsl .ApplyWarp (interp = 'spline' ), name = 'warpmean' )
1195
+ register .connect (inputnode , 'mean_image' , warpmean , 'in_file' )
1196
+ register .connect (mean2anatbbr , 'out_matrix_file' , warpmean , 'premat' )
1195
1197
register .connect (inputnode , 'target_image' , warpmean , 'ref_file' )
1196
1198
register .connect (anat2target_nonlinear , 'fieldcoeff_file' ,
1197
1199
warpmean , 'field_file' )
@@ -1200,15 +1202,11 @@ def create_reg_workflow(name='registration'):
1200
1202
Transform the remaining images. First to anatomical and then to target
1201
1203
"""
1202
1204
1203
- warpall2anat = pe .MapNode (fsl .ApplyWarp (interp = 'spline' ),
1204
- iterfield = ['in_file' ],
1205
- name = 'warpall2anat' )
1206
- register .connect (inputnode , 'source_files' , warpall2anat , 'in_file' )
1207
- register .connect (inputnode , 'anatomical_image' , warpall2anat , 'ref_file' )
1208
- register .connect (mean2anatbbr , 'out_matrix_file' , warpall2anat , 'premat' )
1209
-
1210
- warpall = warpall2anat .clone (name = 'warpall' )
1211
- register .connect (warpall2anat , 'out_file' , warpall , 'in_file' )
1205
+ warpall = pe .MapNode (fsl .ApplyWarp (interp = 'spline' ),
1206
+ iterfield = ['in_file' ],
1207
+ name = 'warpall' )
1208
+ register .connect (inputnode , 'source_files' , warpall , 'in_file' )
1209
+ register .connect (mean2anatbbr , 'out_matrix_file' , warpall , 'premat' )
1212
1210
register .connect (inputnode , 'target_image' , warpall , 'ref_file' )
1213
1211
register .connect (anat2target_nonlinear , 'fieldcoeff_file' ,
1214
1212
warpall , 'field_file' )
0 commit comments