@@ -486,8 +486,11 @@ def _format_arg(self, opt, spec, val):
486
486
retval = '-t %s' % (val )
487
487
return retval
488
488
if opt == 'segmentation_priors' :
489
- _ , _ , ext = split_filename (self .inputs .segmentation_priors [0 ])
490
- retval = "-p BrainSegmentationPrior%02d"
489
+ priors_directory , _ , ext = split_filename (self .inputs .segmentation_priors [0 ])
490
+ if priors_directory is not '' :
491
+ retval = "-p %s/BrainSegmentationPrior%%02d" % (priors_directory )
492
+ else :
493
+ retval = "-p BrainSegmentationPrior%02d"
491
494
retval += ext
492
495
return retval
493
496
return super (ANTSCommand , self )._format_arg (opt , spec , val )
@@ -521,16 +524,19 @@ def _list_outputs(self):
521
524
'BrainSegmentation0N4.' +
522
525
self .inputs .image_suffix )
523
526
outputs ['BrainSegmentationPosteriorsCSF' ] = os .path .join (os .getcwd (),
524
- self .inputs .out_prefix +
525
- 'BrainSegmentationPosteriors01.' +
526
- self .inputs .image_suffix )
527
+ self .inputs .out_prefix +
528
+ 'BrainSegmentationPosteriors01.' +
529
+ self .inputs .image_suffix )
527
530
outputs ['BrainSegmentationPosteriorsGM' ] = os .path .join (os .getcwd (),
531
+ self .inputs .out_prefix +
528
532
'BrainSegmentationPosteriors02.' +
529
533
self .inputs .image_suffix )
530
534
outputs ['BrainSegmentationPosteriorsWM' ] = os .path .join (os .getcwd (),
535
+ self .inputs .out_prefix +
531
536
'BrainSegmentationPosteriors03.' +
532
537
self .inputs .image_suffix )
533
538
outputs ['BrainSegmentationPosteriorsDGM' ] = os .path .join (os .getcwd (),
539
+ self .inputs .out_prefix +
534
540
'BrainSegmentationPosteriors04.' +
535
541
self .inputs .image_suffix )
536
542
outputs ['CorticalThickness' ] = os .path .join (os .getcwd (),
0 commit comments