@@ -38,7 +38,8 @@ from nipype.interfaces.utility import Merge
3838from nipype .interfaces .freesurfer import ReconAll
3939from nipype .interfaces .ants .segmentation import CorticalThickness
4040from nipype .interfaces .ants import (ApplyTransforms , AntsJointFusion ,
41- LabelGeometry , Registration )
41+ LabelGeometry , Registration ,
42+ MultiplyImages )
4243from nipype .utils .misc import human_order_sorted
4344
4445
@@ -392,11 +393,22 @@ else:
392393 if args .num_threads and args .num_threads > 1 :
393394 labeler .inputs .num_threads = args .num_threads
394395
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' )
395403 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' ,
396408 reg , 'fixed_image' )
397- mbFlow .connect (corticalthickness , 'BrainSegmentationN4 ' ,
409+ mbFlow .connect (mask_brain , 'output_product_image ' ,
398410 transformer_nn , 'reference_image' )
399- mbFlow .connect (corticalthickness , 'BrainSegmentationN4' ,
411+ mbFlow .connect (mask_brain , ( 'output_product_image' , tolist ) ,
400412 labeler , 'target_image' )
401413 mbFlow .connect (reg , 'composite_transform' , transformer_nn , 'transforms' )
402414 mbFlow .connect (corticalthickness , 'BrainExtractionMask' , labeler ,
0 commit comments