@@ -1516,7 +1516,7 @@ class FIRSTInputSpec(FSLCommandInputSpec):
1516
1516
desc = ("Method must be one of auto, fast, none, or it can be entered "
1517
1517
"using the 'method_as_numerical_threshold' input" ))
1518
1518
method_as_numerical_threshold = traits .Float (
1519
- argstr = '-m %d ' , position = 4 ,
1519
+ argstr = '-m %.4f ' , position = 4 ,
1520
1520
desc = ("Specify a numerical threshold value or use the 'method' input "
1521
1521
"to choose auto, fast, or none" ))
1522
1522
list_of_specific_structures = traits .List (
@@ -1592,12 +1592,18 @@ def _list_outputs(self):
1592
1592
def _gen_fname (self , name ):
1593
1593
path , outname , ext = split_filename (self .inputs .out_file )
1594
1594
1595
+ method = 'none'
1596
+ if isdefined (self .inputs .method ) and self .inputs .method == 'fast' :
1597
+ method = 'fast'
1598
+
1599
+ if isdefined (self .inputs .method_as_numerical_threshold ):
1600
+ thres = '%.4f' % self .inputs .method_as_numerical_threshold
1601
+ method = thres .replace ('.' , '' )
1602
+
1595
1603
if name == 'original_segmentations' :
1596
- fnames = glob .glob (op .abspath ('%s_all_*_origsegs.nii.gz' % outname ))
1597
- return op .abspath (fnames [0 ])
1604
+ return op .abspath ('%s_all_%s_origsegs.nii.gz' % (outname , method ))
1598
1605
if name == 'segmentation_file' :
1599
- fnames = glob .glob (op .abspath ('%s_all_*_firstseg.nii.gz' % outname ))
1600
- return op .abspath (fnames [0 ])
1606
+ return op .abspath ('%s_all_%s_firstseg.nii.gz' % (outname , method ))
1601
1607
1602
1608
return None
1603
1609
@@ -1616,3 +1622,8 @@ def _gen_mesh_names(self, name, structures):
1616
1622
bvars .append (op .abspath (bvar ))
1617
1623
return bvars
1618
1624
return None
1625
+
1626
+ @property
1627
+ def cmdline (self ):
1628
+ print self ._gen_fname ('original_segmentations' )
1629
+ return super (FIRST , self ).cmdline
0 commit comments