@@ -38,7 +38,8 @@ from nipype.interfaces.utility import Merge
38
38
from nipype .interfaces .freesurfer import ReconAll
39
39
from nipype .interfaces .ants .segmentation import CorticalThickness
40
40
from nipype .interfaces .ants import (ApplyTransforms , AntsJointFusion ,
41
- LabelGeometry , Registration )
41
+ LabelGeometry , Registration ,
42
+ MultiplyImages )
42
43
from nipype .utils .misc import human_order_sorted
43
44
44
45
@@ -392,11 +393,22 @@ else:
392
393
if args .num_threads and args .num_threads > 1 :
393
394
labeler .inputs .num_threads = args .num_threads
394
395
396
+ def tolist (x ):
397
+ return [x ]
398
+
399
+ mask_brain = Node (MultiplyImages (dimension = 3 ,
400
+ output_product_image = 'brain.nii.gz'
401
+ ),
402
+ name = 'mask_brain' )
395
403
mbFlow .connect (corticalthickness , 'BrainSegmentationN4' ,
404
+ mask_brain , 'first_input' )
405
+ mbFlow .connect (corticalthickness , 'BrainExtractionMask' , mask_brain ,
406
+ 'second_input' )
407
+ mbFlow .connect (mask_brain , 'output_product_image' ,
396
408
reg , 'fixed_image' )
397
- mbFlow .connect (corticalthickness , 'BrainSegmentationN4 ' ,
409
+ mbFlow .connect (mask_brain , 'output_product_image ' ,
398
410
transformer_nn , 'reference_image' )
399
- mbFlow .connect (corticalthickness , 'BrainSegmentationN4' ,
411
+ mbFlow .connect (mask_brain , ( 'output_product_image' , tolist ) ,
400
412
labeler , 'target_image' )
401
413
mbFlow .connect (reg , 'composite_transform' , transformer_nn , 'transforms' )
402
414
mbFlow .connect (corticalthickness , 'BrainExtractionMask' , labeler ,
0 commit comments