@@ -1718,23 +1718,14 @@ class OutlierCountInputSpec(CommandLineInputSpec):
1718
1718
out_file = File (
1719
1719
name_template = '%s_outliers' ,
1720
1720
name_source = ['in_file' ],
1721
- argstr = '> %s' ,
1722
1721
keep_extension = False ,
1723
- position = - 1 ,
1724
1722
desc = 'capture standard output' )
1725
1723
1726
1724
1727
1725
class OutlierCountOutputSpec (TraitedSpec ):
1728
- out_outliers = File (
1729
- exists = True ,
1730
- desc = 'output image file name' )
1731
- out_file = File (
1732
- name_template = '%s_tqual' ,
1733
- name_source = ['in_file' ],
1734
- argstr = '> %s' ,
1735
- keep_extension = False ,
1736
- position = - 1 ,
1737
- desc = 'capture standard output' )
1726
+ out_outliers = File (exists = True ,
1727
+ desc = 'output image file name' )
1728
+ out_file = File (desc = 'capture standard output' )
1738
1729
1739
1730
1740
1731
class OutlierCount (CommandLine ):
@@ -1759,20 +1750,34 @@ class OutlierCount(CommandLine):
1759
1750
_cmd = '3dToutcount'
1760
1751
input_spec = OutlierCountInputSpec
1761
1752
output_spec = OutlierCountOutputSpec
1753
+ _terminal_output = 'file_split'
1762
1754
1763
1755
def _parse_inputs (self , skip = None ):
1764
1756
if skip is None :
1765
1757
skip = []
1766
1758
1759
+ # This is not strictly an input, but needs be
1760
+ # set before run() is called.
1761
+ if self .terminal_output == 'none' :
1762
+ self .terminal_output = 'file_split'
1763
+
1767
1764
if not self .inputs .save_outliers :
1768
1765
skip += ['outliers_file' ]
1769
1766
return super (OutlierCount , self )._parse_inputs (skip )
1770
1767
1768
+ def _run_interface (self , runtime ):
1769
+ runtime = super (OutlierCount , self )._run_interface (runtime )
1770
+
1771
+ # Read from runtime.stdout or runtime.merged
1772
+ with open (op .abspath (self .inputs .out_file ), 'w' ) as outfh :
1773
+ outfh .write (runtime .stdout or runtime .merged )
1774
+ return runtime
1775
+
1771
1776
def _list_outputs (self ):
1772
1777
outputs = self .output_spec ().get ()
1778
+ outputs ['out_file' ] = op .abspath (self .inputs .out_file )
1773
1779
if self .inputs .save_outliers :
1774
1780
outputs ['out_outliers' ] = op .abspath (self .inputs .outliers_file )
1775
- outputs ['out_file' ] = op .abspath (self .inputs .out_file )
1776
1781
return outputs
1777
1782
1778
1783
0 commit comments