@@ -232,7 +232,7 @@ def all_fsl_pipeline(name='fsl_all_correct',
232
232
outputnode = pe .Node (niu .IdentityInterface (
233
233
fields = ['out_file' , 'out_mask' , 'out_bvec' ]), name = 'outputnode' )
234
234
235
- def _gen_index (in_file ):
235
+ def gen_index (in_file ):
236
236
import numpy as np
237
237
import nibabel as nb
238
238
import os
@@ -242,6 +242,9 @@ def _gen_index(in_file):
242
242
np .savetxt (out_file , np .ones ((vols ,)).T )
243
243
return out_file
244
244
245
+ gen_idx = pe .Node (niu .Function (
246
+ input_names = ['in_file' ], output_names = ['out_file' ],
247
+ function = gen_index ), name = 'gen_index' )
245
248
avg_b0_0 = pe .Node (niu .Function (
246
249
input_names = ['in_dwi' , 'in_bval' ], output_names = ['out_file' ],
247
250
function = b0_average ), name = 'b0_avg_pre' )
@@ -272,10 +275,11 @@ def _gen_index(in_file):
272
275
('topup.out_fieldcoef' , 'in_topup_fieldcoef' ),
273
276
('topup.out_movpar' , 'in_topup_movpar' )]),
274
277
(bet_dwi0 , ecc , [('mask_file' , 'in_mask' )]),
278
+ (inputnode , gen_idx , [('in_file' , 'in_file' )]),
275
279
(inputnode , ecc , [('in_file' , 'in_file' ),
276
- (('in_file' , _gen_index ), 'in_index' ),
277
280
('in_bval' , 'in_bval' ),
278
281
('in_bvec' , 'in_bvec' )]),
282
+ (gen_idx , ecc , [('out_file' , 'in_index' )]),
279
283
(inputnode , rot_bvec , [('in_bvec' , 'in_bvec' )]),
280
284
(ecc , rot_bvec , [('out_parameter' , 'eddy_params' )]),
281
285
(ecc , avg_b0_1 , [('out_corrected' , 'in_dwi' )]),
0 commit comments