Skip to content

Commit 7975ed1

Browse files
committed
fix: use masked brain as reference image
1 parent 4848ae3 commit 7975ed1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

mindboggle/mindboggle123

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ from nipype.interfaces.utility import Merge
3838
from nipype.interfaces.freesurfer import ReconAll
3939
from nipype.interfaces.ants.segmentation import CorticalThickness
4040
from nipype.interfaces.ants import (ApplyTransforms, AntsJointFusion,
41-
LabelGeometry, Registration)
41+
LabelGeometry, Registration,
42+
MultiplyImages)
4243
from 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

Comments
 (0)