|
14 | 14 | import re
|
15 | 15 | from warnings import warn
|
16 | 16 |
|
17 |
| -from .base import AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, Info |
| 17 | +from .base import AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, Info, no_afni |
18 | 18 | from ..base import CommandLineInputSpec, CommandLine, OutputMultiPath
|
19 | 19 | from ..base import (Directory, TraitedSpec,
|
20 | 20 | traits, isdefined, File, InputMultiPath, Undefined)
|
21 | 21 | from ...utils.filemanip import (load_json, save_json, split_filename)
|
22 | 22 | from ...utils.filemanip import fname_presuffix
|
23 | 23 |
|
24 |
| - |
25 | 24 | class To3DInputSpec(AFNICommandInputSpec):
|
26 | 25 | out_file = File(name_template="%s", desc='output image file name',
|
27 | 26 | argstr='-prefix %s', name_source=["in_folder"])
|
@@ -1235,9 +1234,7 @@ class SkullStrip(AFNICommand):
|
1235 | 1234 | output_spec = AFNICommandOutputSpec
|
1236 | 1235 |
|
1237 | 1236 | def __init__(self, **inputs):
|
1238 |
| - from .base import Info, no_afni |
1239 | 1237 | super(SkullStrip, self).__init__(**inputs)
|
1240 |
| - |
1241 | 1238 | if not no_afni():
|
1242 | 1239 | v = Info.version()
|
1243 | 1240 |
|
@@ -2138,6 +2135,16 @@ class Hist(CommandLine):
|
2138 | 2135 | _cmd = '3dHist'
|
2139 | 2136 | input_spec = HistInputSpec
|
2140 | 2137 | output_spec = HistOutputSpec
|
| 2138 | + _redirect_x = True |
| 2139 | + |
| 2140 | + def __init__(self, **inputs): |
| 2141 | + super(Hist, self).__init__(**inputs) |
| 2142 | + if not no_afni(): |
| 2143 | + version = Info.version() |
| 2144 | + |
| 2145 | + # As of AFNI 16.0.00, redirect_x is not needed |
| 2146 | + if isinstance(version[0], int) and version[0] > 15: |
| 2147 | + self._redirect_x = False |
2141 | 2148 |
|
2142 | 2149 | def _parse_inputs(self, skip=None):
|
2143 | 2150 | if not self.inputs.showhist:
|
|
0 commit comments