@@ -229,7 +229,7 @@ def hmc_pipeline(name='motion_correct'):
229
229
them to one reference image. Finally, the `b`-matrix is rotated accordingly [Leemans09]_
230
230
making use of the rotation matrix obtained by FLIRT.
231
231
232
- Search angles have been limited to 3.5 degrees, based on results in [Yendiki13]_.
232
+ Search angles have been limited to 4 degrees, based on results in [Yendiki13]_.
233
233
234
234
A list of rigid transformation matrices is provided, so that transforms can be
235
235
chained. This is useful to correct for artifacts with only one interpolation process (as
@@ -276,18 +276,24 @@ def hmc_pipeline(name='motion_correct'):
276
276
outputnode.out_xfms - list of transformation matrices
277
277
278
278
"""
279
- inputnode = pe .Node (niu .IdentityInterface (fields = ['in_file' , 'ref_num' , 'in_bvec' ,
280
- 'in_mask' ]), name = 'inputnode' )
279
+ inputnode = pe .Node (niu .IdentityInterface (fields = ['in_file' , 'ref_num' ,
280
+ 'in_bvec' , ' in_mask' ]), name = 'inputnode' )
281
281
split = pe .Node (fsl .Split (dimension = 't' ), name = 'SplitDWIs' )
282
282
pick_ref = pe .Node (niu .Select (), name = 'Pick_b0' )
283
+ enhb0 = pe .Node (niu .Function (input_names = ['in_file' ],
284
+ output_names = ['out_file' ], function = enhance ),
285
+ name = 'B0Equalize' )
286
+ enhdw = pe .MapNode (niu .Function (input_names = ['in_file' ],
287
+ output_names = ['out_file' ], function = enhance ),
288
+ name = 'DWEqualize' , iterfield = ['in_file' ])
283
289
flirt = pe .MapNode (fsl .FLIRT (interp = 'spline' , cost = 'normmi' ,
284
- cost_func = 'normmi' , dof = 6 , bins = 64 , save_log = True ,
285
- searchr_x = [- 4 ,4 ], searchr_y = [- 4 ,4 ], searchr_z = [- 4 ,4 ],
290
+ cost_func = 'normmi' , dof = 6 , bins = 64 , save_log = True ,
291
+ searchr_x = [- 4 , 4 ], searchr_y = [- 4 , 4 ], searchr_z = [- 4 , 4 ],
286
292
fine_search = 1 , coarse_search = 10 , padding_size = 1 ),
287
293
name = 'CoRegistration' , iterfield = ['in_file' ])
288
294
rot_bvec = pe .Node (niu .Function (input_names = ['in_bvec' , 'in_matrix' ],
289
- output_names = ['out_file' ], function = rotate_bvecs ),
290
- name = 'Rotate_Bvec' )
295
+ output_names = ['out_file' ], function = rotate_bvecs ),
296
+ name = 'Rotate_Bvec' )
291
297
thres = pe .MapNode (fsl .Threshold (thresh = 0.0 ), iterfield = ['in_file' ],
292
298
name = 'RemoveNegative' )
293
299
merge = pe .Node (fsl .Merge (dimension = 't' ), name = 'MergeDWIs' )
@@ -301,10 +307,12 @@ def hmc_pipeline(name='motion_correct'):
301
307
,(split , pick_ref , [('out_files' , 'inlist' )])
302
308
,(inputnode , pick_ref , [(('ref_num' , _checkrnum ), 'index' )])
303
309
,(inputnode , flirt , [('in_mask' , 'ref_weight' )])
304
- ,(split , flirt , [('out_files' , 'in_file' )])
310
+ ,(pick_ref , enhb0 , [('out' , 'in_file' )])
311
+ ,(split , enhdw , [('out_files' , 'in_file' )])
312
+ ,(enhb0 , flirt , [('out_file' , 'reference' )])
313
+ ,(enhdw , flirt , [('out_file' , 'in_file' )])
305
314
,(inputnode , rot_bvec , [('in_bvec' , 'in_bvec' )])
306
315
,(flirt , rot_bvec , [('out_matrix_file' , 'in_matrix' )])
307
- ,(pick_ref , flirt , [('out' , 'reference' )])
308
316
,(flirt , thres , [('out_file' , 'in_file' )])
309
317
,(thres , merge , [('out_file' , 'in_files' )])
310
318
,(merge , outputnode , [('merged_file' , 'out_file' )])
0 commit comments