@@ -308,32 +308,38 @@ def num_copes(files):
308
308
registration .inputs .inputspec .target_image_brain = fsl .Info .standard_image ('MNI152_T1_2mm_brain.nii.gz' )
309
309
registration .inputs .inputspec .config_file = 'T1_2_MNI152_2mm'
310
310
311
- def merge_files (copes , varcopes ):
311
+ def merge_files (copes , varcopes , zstats ):
312
312
out_files = []
313
313
splits = []
314
314
out_files .extend (copes )
315
315
splits .append (len (copes ))
316
316
out_files .extend (varcopes )
317
317
splits .append (len (varcopes ))
318
+ out_files .extend (zstats )
319
+ splits .append (len (zstats ))
318
320
return out_files , splits
319
321
320
- mergefunc = pe .Node (niu .Function (input_names = ['copes' , 'varcopes' ],
322
+ mergefunc = pe .Node (niu .Function (input_names = ['copes' , 'varcopes' ,
323
+ 'zstats' ],
321
324
output_names = ['out_files' , 'splits' ],
322
325
function = merge_files ),
323
326
name = 'merge_files' )
324
327
wf .connect ([(fixed_fx .get_node ('outputspec' ), mergefunc ,
325
328
[('copes' , 'copes' ),
326
329
('varcopes' , 'varcopes' ),
330
+ ('zstats' , 'zstats' ),
327
331
])])
328
332
wf .connect (mergefunc , 'out_files' , registration , 'inputspec.source_files' )
329
333
330
334
def split_files (in_files , splits ):
331
335
copes = in_files [:splits [1 ]]
332
- varcopes = in_files [splits [1 ]:]
333
- return copes , varcopes
336
+ varcopes = in_files [splits [1 ]:splits [2 ]]
337
+ zstats = in_files [splits [2 ]:]
338
+ return copes , varcopes , zstats
334
339
335
340
splitfunc = pe .Node (niu .Function (input_names = ['in_files' , 'splits' ],
336
- output_names = ['copes' , 'varcopes' ],
341
+ output_names = ['copes' , 'varcopes' ,
342
+ 'zstats' ],
337
343
function = split_files ),
338
344
name = 'split_files' )
339
345
wf .connect (mergefunc , 'splits' , splitfunc , 'splits' )
@@ -390,6 +396,7 @@ def get_subs(subject_id, conds, model_id, task_id):
390
396
wf .connect ([(splitfunc , datasink ,
391
397
[('copes' , 'copes.mni' ),
392
398
('varcopes' , 'varcopes.mni' ),
399
+ ('zstats' , 'zstats.mni' ),
393
400
])])
394
401
wf .connect (registration , 'outputspec.transformed_mean' , datasink , 'mean.mni' )
395
402
wf .connect (registration , 'outputspec.func2anat_transform' , datasink , 'xfm.mean2anat' )
0 commit comments