Skip to content

Commit 286fd7c

Browse files
author
Oscar Esteban
committed
3dHist in afni < 16 uses virtual display
1 parent f60ffc2 commit 286fd7c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
import re
1515
from warnings import warn
1616

17-
from .base import AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, Info
17+
from .base import AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, Info, no_afni
1818
from ..base import CommandLineInputSpec, CommandLine, OutputMultiPath
1919
from ..base import (Directory, TraitedSpec,
2020
traits, isdefined, File, InputMultiPath, Undefined)
2121
from ...utils.filemanip import (load_json, save_json, split_filename)
2222
from ...utils.filemanip import fname_presuffix
2323

24-
2524
class To3DInputSpec(AFNICommandInputSpec):
2625
out_file = File(name_template="%s", desc='output image file name',
2726
argstr='-prefix %s', name_source=["in_folder"])
@@ -1235,9 +1234,7 @@ class SkullStrip(AFNICommand):
12351234
output_spec = AFNICommandOutputSpec
12361235

12371236
def __init__(self, **inputs):
1238-
from .base import Info, no_afni
12391237
super(SkullStrip, self).__init__(**inputs)
1240-
12411238
if not no_afni():
12421239
v = Info.version()
12431240

@@ -2138,6 +2135,16 @@ class Hist(CommandLine):
21382135
_cmd = '3dHist'
21392136
input_spec = HistInputSpec
21402137
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
21412148

21422149
def _parse_inputs(self, skip=None):
21432150
if not self.inputs.showhist:

0 commit comments

Comments
 (0)