@@ -1516,7 +1516,7 @@ class FIRSTInputSpec(FSLCommandInputSpec):
15161516 desc = ("Method must be one of auto, fast, none, or it can be entered "
15171517 "using the 'method_as_numerical_threshold' input" ))
15181518 method_as_numerical_threshold = traits .Float (
1519- argstr = '-m %d ' , position = 4 ,
1519+ argstr = '-m %.4f ' , position = 4 ,
15201520 desc = ("Specify a numerical threshold value or use the 'method' input "
15211521 "to choose auto, fast, or none" ))
15221522 list_of_specific_structures = traits .List (
@@ -1592,12 +1592,18 @@ def _list_outputs(self):
15921592 def _gen_fname (self , name ):
15931593 path , outname , ext = split_filename (self .inputs .out_file )
15941594
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+
15951603 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 ))
15981605 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 ))
16011607
16021608 return None
16031609
@@ -1616,3 +1622,8 @@ def _gen_mesh_names(self, name, structures):
16161622 bvars .append (op .abspath (bvar ))
16171623 return bvars
16181624 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