@@ -1676,13 +1676,13 @@ class OutlierCountInputSpec(CommandLineInputSpec):
16761676 False ,
16771677 usedefault = True ,
16781678 argstr = '-autoclip' ,
1679- xor = ['in_file ' ],
1679+ xor = ['mask ' ],
16801680 desc = 'clip off small voxels' )
16811681 automask = traits .Bool (
16821682 False ,
16831683 usedefault = True ,
16841684 argstr = '-automask' ,
1685- xor = ['in_file ' ],
1685+ xor = ['mask ' ],
16861686 desc = 'clip off small voxels' )
16871687 fraction = traits .Bool (
16881688 False ,
@@ -1718,28 +1718,19 @@ class OutlierCountInputSpec(CommandLineInputSpec):
17181718 out_file = File (
17191719 name_template = '%s_outliers' ,
17201720 name_source = ['in_file' ],
1721- argstr = '> %s' ,
17221721 keep_extension = False ,
1723- position = - 1 ,
17241722 desc = 'capture standard output' )
17251723
17261724
17271725class 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' )
17381729
17391730
17401731class OutlierCount (CommandLine ):
1741- """Calculates number of 'outliers' a 3D+ time dataset, at each
1742- time point, and writes the results to stdout .
1732+ """Calculates number of 'outliers' at each time point of a
1733+ a 3D+ time dataset .
17431734
17441735 For complete details, see the `3dToutcount Documentation
17451736 <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dToutcount.html>`_
@@ -1751,28 +1742,42 @@ class OutlierCount(CommandLine):
17511742 >>> toutcount = afni.OutlierCount()
17521743 >>> toutcount.inputs.in_file = 'functional.nii'
17531744 >>> toutcount.cmdline # doctest: +ELLIPSIS +ALLOW_UNICODE
1754- '3dToutcount functional.nii > functional_outliers '
1745+ '3dToutcount functional.nii'
17551746 >>> res = toutcount.run() # doctest: +SKIP
17561747
17571748 """
17581749
17591750 _cmd = '3dToutcount'
17601751 input_spec = OutlierCountInputSpec
17611752 output_spec = OutlierCountOutputSpec
1753+ _terminal_output = 'file_split'
17621754
17631755 def _parse_inputs (self , skip = None ):
17641756 if skip is None :
17651757 skip = []
17661758
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+
17671764 if not self .inputs .save_outliers :
17681765 skip += ['outliers_file' ]
17691766 return super (OutlierCount , self )._parse_inputs (skip )
17701767
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+
17711776 def _list_outputs (self ):
17721777 outputs = self .output_spec ().get ()
1778+ outputs ['out_file' ] = op .abspath (self .inputs .out_file )
17731779 if self .inputs .save_outliers :
17741780 outputs ['out_outliers' ] = op .abspath (self .inputs .outliers_file )
1775- outputs ['out_file' ] = op .abspath (self .inputs .out_file )
17761781 return outputs
17771782
17781783
@@ -1880,13 +1885,10 @@ class ROIStatsInputSpec(CommandLineInputSpec):
18801885 desc = 'execute quietly' ,
18811886 argstr = '-quiet' ,
18821887 position = 1 )
1883- terminal_output = traits .Enum (
1884- 'allatonce' ,
1888+ terminal_output = traits .Enum ('allatonce' , deprecated = '1.0.0' ,
18851889 desc = 'Control terminal output:`allatonce` - waits till command is '
18861890 'finished to display output' ,
1887- nohash = True ,
1888- mandatory = True ,
1889- usedefault = True )
1891+ nohash = True )
18901892
18911893
18921894class ROIStatsOutputSpec (TraitedSpec ):
@@ -1915,6 +1917,7 @@ class ROIStats(AFNICommandBase):
19151917
19161918 """
19171919 _cmd = '3dROIstats'
1920+ _terminal_output = 'allatonce'
19181921 input_spec = ROIStatsInputSpec
19191922 output_spec = ROIStatsOutputSpec
19201923
0 commit comments