@@ -295,7 +295,7 @@ class antsCorticalThicknessInputSpec(ANTSCommandInputSpec):
295
295
dimension = traits .Enum (3 , 2 , argstr = '-d %d' , usedefault = True ,
296
296
desc = 'image dimension (2 or 3)' )
297
297
anatomical_image = File (exists = True ,
298
- argstr = '-a %s' ,
298
+ argstr = '-a %s' ,
299
299
desc = 'Structural *intensity* image, typically T1.'
300
300
'If more than one anatomical image is specified,'
301
301
'subsequently specified images are used during the'
@@ -308,41 +308,43 @@ class antsCorticalThicknessInputSpec(ANTSCommandInputSpec):
308
308
argstr = '-e %s' ,
309
309
desc = 'Anatomical *intensity* template (possibly created using a'
310
310
'population data set with buildtemplateparallel.sh in ANTs).'
311
- 'This template is *not* skull-stripped.' )
311
+ 'This template is *not* skull-stripped.' ,
312
+ mandatory = True )
312
313
brain_probability_mask = File (exists = True ,
313
314
argstr = '-m %s' , desc = 'brain probability mask in template space' ,
314
- mandatory = True , copyfile = False )
315
+ copyfile = False , mandatory = True )
315
316
segmentation_priors = InputMultiPath (File (exists = True ),
316
- argstr = '-p %s' )
317
+ argstr = '-p %s' , mandatory = True )
317
318
out_prefix = traits .Str ('antsCT_' , argstr = '-o %s' , usedefault = True ,
318
319
desc = ('Prefix that is prepended to all output'
319
320
' files (default = antsCT_)' ))
320
321
image_suffix = traits .Str ('nii.gz' , desc = ('any of standard ITK formats,'
321
- ' nii.gz is default' ), mandatory = False , argstr = '-s %s' ,
322
+ ' nii.gz is default' ), mandatory = False , argstr = '-s %s' ,
322
323
usedefault = True )
323
- t1_registration_template = File (exists = True ,
324
+ t1_registration_template = File (exists = True ,
324
325
desc = ('Anatomical *intensity* template'
325
- '(assumed to be skull-stripped). A common'
326
+ '(assumed to be skull-stripped). A common'
326
327
'case would be where this would be the same'
327
328
'template as specified in the -e option which'
328
329
'is not skull stripped.' ),
329
- mandatory = True , argstr = '-t %s' )
330
+ argstr = '-t %s' ,
331
+ mandatory = True )
330
332
extraction_registration_mask = File (exists = True , argstr = '-f %s' ,
331
333
mandatory = False , desc = 'Mask (defined in the template'
332
334
'space) used during registration for brain extraction.' )
333
- keep_temporary_files = traits .Int (argstrr = '-k %d' ,
335
+ keep_temporary_files = traits .Int (argstrr = '-k %d' ,
334
336
desc = 'Keep brain extraction/segmentation'
335
337
'warps, etc (default = 0).' , mandatory = False )
336
- max_iterations = traits .Int (argstr = '-i %d' ,
337
- desc = 'ANTS registration max iterations'
338
+ max_iterations = traits .Int (argstr = '-i %d' ,
339
+ desc = 'ANTS registration max iterations'
338
340
'(default = 100x100x70x20)' , mandatory = False )
339
341
prior_segmentation_weight = traits .Float (mandatory = False , argstr = '-w %f' ,
340
342
desc = 'Atropos spatial prior *probability* weight for'
341
343
'the segmentation' )
342
344
segmentation_iterations = traits .Int (argstr = '-n %d' , mandatory = False ,
343
345
desc = 'N4 -> Atropos -> N4 iterations during segmentation'
344
346
'(default = 3)' )
345
- posterior_formulation = traits .Str (argstr = '-b %s' , mandatory = False ,
347
+ posterior_formulation = traits .Str (argstr = '-b %s' , mandatory = False ,
346
348
desc = ('Atropos posterior formulation and whether or not'
347
349
'to use mixture model proportions.'
348
350
'''e.g 'Socrates[1]' (default) or 'Aristotle[1]'.'''
@@ -363,7 +365,7 @@ class antsCorticalThicknessInputSpec(ANTSCommandInputSpec):
363
365
label_propagation = traits .Str (argstr = '-l %s' , mandatory = False ,
364
366
desc = 'Incorporate a distance prior one the posterior formulation. Should be'
365
367
'''of the form 'label[lambda,boundaryProbability]' where label'''
366
- 'is a value of 1,2,3,... denoting label ID. The label'
368
+ 'is a value of 1,2,3,... denoting label ID. The label'
367
369
'probability for anything outside the current label'
368
370
' = boundaryProbability * exp( -lambda * distanceFromBoundary )'
369
371
'Intuitively, smaller lambda values will increase the spatial capture'
@@ -372,7 +374,7 @@ class antsCorticalThicknessInputSpec(ANTSCommandInputSpec):
372
374
quick_registration = traits .Bool (argstr = '-q 1' , mandatory = False ,
373
375
desc = 'If = 1, use antsRegistrationSyNQuick.sh as the basis for registration'
374
376
'during brain extraction, brain segmentation, and'
375
- '(optional) normalization to a template.'
377
+ '(optional) normalization to a template.'
376
378
'Otherwise use antsRegistrationSyN.sh (default = 0).' )
377
379
debug = traits .Bool (argstr = '-z 1' , mandatory = False ,
378
380
desc = 'If > 0, runs a faster version of the script.'
@@ -412,17 +414,17 @@ class antsCorticalThickness(ANTSCommand):
412
414
Examples
413
415
--------
414
416
>>> from nipype.interfaces.ants.segmentation import antsCorticalThickness
415
- >>> corticalthickness = anstCorticalThickness ()
417
+ >>> corticalthickness = antsCorticalThickness ()
416
418
>>> corticalthickness.inputs.dimension = 3
417
419
>>> corticalthickness.inputs.anatomical_image ='T1.nii.gz'
418
420
>>> corticalthickness.inputs.brain_template = 'study_template.nii.gz'
419
421
>>> corticalthickness.inputs.brain_probability_mask ='ProbabilityMaskOfStudyTemplate.nii.gz'
420
- >>> corticalthickness.inputs.segmentation_priors =['CSF .nii.gz','WM .nii.gz','GM .nii.gz','DEEP_GM .nii.gz']
422
+ >>> corticalthickness.inputs.segmentation_priors = ['BrainSegmentationPrior01 .nii.gz', 'BrainSegmentationPrior02 .nii.gz', 'BrainSegmentationPrior03 .nii.gz', 'BrainSegmentationPrior04 .nii.gz']
421
423
>>> corticalthickness.inputs.t1_registration_template = 'brain_study_template.nii.gz'
422
424
>>> corticalthickness.cmdline
423
- 'antsCorticalThickness.sh -d 3 - a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -o antsCT_ -p BrainSegmentationPrior%0d .nii.gz -t brain_study_template.nii.gz'
425
+ 'antsCorticalThickness.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -d 3 -s nii.gz - o antsCT_ -p BrainSegmentationPrior%02d .nii.gz -t brain_study_template.nii.gz'
424
426
"""
425
-
427
+
426
428
input_spec = antsCorticalThicknessInputSpec
427
429
output_spec = antsCorticalThicknessoutputSpec
428
430
_cmd = 'antsCorticalThickness.sh'
@@ -444,7 +446,7 @@ def _format_arg(self, opt, spec, val):
444
446
return retval
445
447
if opt == 'segmentation_priors' :
446
448
_ , _ , ext = split_filename (self .inputs .segmentation_priors [0 ])
447
- retval = "-p priors/ BrainSegmentationPrior%02d"
449
+ retval = "-p BrainSegmentationPrior%02d"
448
450
retval += ext
449
451
return retval
450
452
return super (ANTSCommand , self )._format_arg (opt , spec , val )
@@ -474,7 +476,7 @@ def _list_outputs(self):
474
476
self .inputs .image_suffix )
475
477
outputs ['BrainSegmentationN4' ] = os .path .join (os .getcwd (),
476
478
self .inputs .out_prefix +
477
- 'BrainSegmentation0N4.' +
479
+ 'BrainSegmentation0N4.' +
478
480
self .inputs .image_suffix )
479
481
outputs ['BrainSegmentationPosteriorsCSF' ] = os .path .join (os .getcwd (),
480
482
self .inputs .out_prefix +
@@ -496,14 +498,14 @@ def _list_outputs(self):
496
498
os .getcwd (),
497
499
'TemplateToSubject1GenericAffine.mat' )
498
500
outputs ['TemplateToSubject0Warp' ] = os .path .join (os .getcwd (),
499
- self .inputs .out_prefix + 'TemplateToSubject0Warp.' +
501
+ self .inputs .out_prefix + 'TemplateToSubject0Warp.' +
500
502
self .inputs .image_suffix )
501
503
outputs ['SubjectToTemplate1Warp' ] = os .path .join (os .getcwd (),
502
- self .inputs .out_prefix + 'SubjectToTemplate1Warp' +
504
+ self .inputs .out_prefix + 'SubjectToTemplate1Warp' +
503
505
self .inputs .image_suffix )
504
506
outputs ['SubjectToTemplate0GenericAffine' ] = os .path .join (os .getcwd (),
505
507
self .inputs .out_prefix + 'SubjectToTemplate0GenericAffine.mat' )
506
- outputs ['TemplateToSubjectLogJacobian' ] = os .path .join (os .getcwd (),
508
+ outputs ['TemplateToSubjectLogJacobian' ] = os .path .join (os .getcwd (),
507
509
self .inputs .out_prefix + 'subjectToTemplateLogJacobian.' +
508
510
self .inputs .image_suffix )
509
511
return outputs
0 commit comments