File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,23 @@ def version():
37
37
Version number as string or None if AFNI not found
38
38
39
39
"""
40
+ import re
40
41
clout = CommandLine (command = 'afni_vcheck' ,
41
42
terminal_output = 'allatonce' ).run ()
42
- out = clout .runtime .stdout
43
- return out .split ('\n ' )[1 ]
43
+ out = clout .runtime .stdout .split ('\n ' )[1 ]
44
+
45
+ # Try to parse the version number
46
+ m = re .search (r'[\.\d]*$' , out )
47
+ # is the format kept through versions before 16.x?
48
+ if m is None or not m .group (0 ):
49
+ return out
50
+
51
+ v = m .group (0 ).split ('.' )
52
+ try :
53
+ v = [int (n ) for n in v ]
54
+ except ValueError :
55
+ return out
56
+ return tuple (v )
44
57
45
58
@classmethod
46
59
def outputtype_to_ext (cls , outputtype ):
Original file line number Diff line number Diff line change @@ -1235,6 +1235,15 @@ class SkullStrip(AFNICommand):
1235
1235
input_spec = SkullStripInputSpec
1236
1236
output_spec = AFNICommandOutputSpec
1237
1237
1238
+ def __init__ (self , ** inputs ):
1239
+ from .base import Info
1240
+ super (SkullStrip , self ).__init__ (** inputs )
1241
+ v = Info .version ()
1242
+
1243
+ # As of AFNI 16.0.00, redirect_x is not needed
1244
+ if isinstance (v [0 ], int ) and v [0 ] > 15 :
1245
+ self ._redirect_x = False
1246
+
1238
1247
1239
1248
class TCatInputSpec (AFNICommandInputSpec ):
1240
1249
in_files = InputMultiPath (
You can’t perform that action at this time.
0 commit comments