@@ -294,7 +294,8 @@ def create_workflow(files,
294
294
# Compute the median image across runs
295
295
calc_median = Node (Function (input_names = ['in_files' ],
296
296
output_names = ['median_file' ],
297
- function = median ),
297
+ function = median ,
298
+ imports = imports ),
298
299
name = 'median' )
299
300
wf .connect (tsnr , 'detrended_file' , calc_median , 'in_files' )
300
301
@@ -387,15 +388,17 @@ def create_workflow(files,
387
388
motreg = Node (Function (input_names = ['motion_params' , 'order' ,
388
389
'derivatives' ],
389
390
output_names = ['out_files' ],
390
- function = motion_regressors ),
391
+ function = motion_regressors ,
392
+ imports = imports ),
391
393
name = 'getmotionregress' )
392
394
wf .connect (realign , 'par_file' , motreg , 'motion_params' )
393
395
394
396
# Create a filter to remove motion and art confounds
395
397
createfilter1 = Node (Function (input_names = ['motion_params' , 'comp_norm' ,
396
398
'outliers' ],
397
399
output_names = ['out_files' ],
398
- function = build_filter1 ),
400
+ function = build_filter1 ,
401
+ imports = imports ),
399
402
name = 'makemotionbasedfilter' )
400
403
wf .connect (motreg , 'out_files' , createfilter1 , 'motion_params' )
401
404
wf .connect (art , 'norm_files' , createfilter1 , 'comp_norm' )
@@ -417,7 +420,8 @@ def create_workflow(files,
417
420
createfilter2 = MapNode (Function (input_names = ['realigned_file' , 'mask_file' ,
418
421
'num_components' ],
419
422
output_names = ['out_files' ],
420
- function = extract_noise_components ),
423
+ function = extract_noise_components ,
424
+ imports = imports ),
421
425
iterfield = ['realigned_file' ],
422
426
name = 'makecompcorrfilter' )
423
427
createfilter2 .inputs .num_components = num_components
@@ -514,7 +518,8 @@ def create_workflow(files,
514
518
# Combine left and right hemisphere to text file
515
519
combiner = MapNode (Function (input_names = ['left' , 'right' ],
516
520
output_names = ['out_file' ],
517
- function = combine_hemi ),
521
+ function = combine_hemi ,
522
+ imports = imports ),
518
523
iterfield = ['left' , 'right' ],
519
524
name = "combiner" )
520
525
wf .connect (samplerlh , 'out_file' , combiner , 'left' )
@@ -601,7 +606,8 @@ def create_workflow(files,
601
606
ts2txt = MapNode (Function (input_names = ['timeseries_file' , 'label_file' ,
602
607
'indices' ],
603
608
output_names = ['out_file' ],
604
- function = extract_subrois ),
609
+ function = extract_subrois ,
610
+ imports = imports ),
605
611
iterfield = ['timeseries_file' ],
606
612
name = 'getsubcortts' )
607
613
ts2txt .inputs .indices = dict (zip ([8 ] + range (10 , 14 ) + [17 , 18 , 26 , 47 ] +
0 commit comments