@@ -96,21 +96,21 @@ def standard_image(img_name):
96
96
return os .path .join (basedir , img_name )
97
97
98
98
99
- class AFNITraitedSpec (CommandLineInputSpec ):
99
+ class AFNIBaseCommandInputSpec (CommandLineInputSpec ):
100
100
outputtype = traits .Enum ('AFNI' , Info .ftypes .keys (),
101
101
desc = 'AFNI output filetype' )
102
102
103
103
104
- class AFNICommand (CommandLine ):
104
+ class AFNIBaseCommand (CommandLine ):
105
105
"""General support for AFNI commands. Every AFNI command accepts 'outputtype' input. For example:
106
106
afni.Threedsetup(outputtype='NIFTI_GZ')
107
107
"""
108
108
109
- input_spec = AFNITraitedSpec
109
+ input_spec = AFNIBaseCommandInputSpec
110
110
_outputtype = None
111
111
112
112
def __init__ (self , ** inputs ):
113
- super (AFNICommand , self ).__init__ (** inputs )
113
+ super (AFNIBaseCommand , self ).__init__ (** inputs )
114
114
self .inputs .on_trait_change (self ._output_update , 'outputtype' )
115
115
116
116
if self ._outputtype is None :
@@ -186,7 +186,7 @@ def _gen_fname(self, basename, cwd=None, suffix='_afni', change_ext=True, prefix
186
186
return fname
187
187
188
188
189
- class AFNIPrefixInputSpec ( AFNITraitedSpec ):
189
+ class AFNICommandInputSpec ( AFNIBaseCommandInputSpec ):
190
190
out_file = File ("%s_afni" , desc = 'output image file name' ,
191
191
argstr = '-prefix %s' , xor = ['out_file' , 'prefix' , 'suffix' ], name_source = "in_file" , usedefault = True )
192
192
prefix = traits .Str (
@@ -195,8 +195,8 @@ class AFNIPrefixInputSpec(AFNITraitedSpec):
195
195
desc = 'output image suffix' , deprecated = 0.8 , new_name = "out_file" )
196
196
197
197
198
- class AFNIPrefixCommand ( AFNICommand ):
199
- input_spec = AFNIPrefixInputSpec
198
+ class AFNICommand ( AFNIBaseCommand ):
199
+ input_spec = AFNICommandInputSpec
200
200
201
201
def _gen_filename (self , name ):
202
202
trait_spec = self .inputs .trait (name )
@@ -212,7 +212,7 @@ def _gen_filename(self, name):
212
212
getattr (self .inputs , trait_spec .name_source ))
213
213
return self ._gen_fname (basename = base , prefix = prefix , suffix = suffix , cwd = '' )
214
214
else :
215
- return super (AFNIPrefixCommand , self )._gen_filename (name )
215
+ return super (AFNICommand , self )._gen_filename (name )
216
216
217
217
def _overload_extension (self , value ):
218
218
path , base , _ = split_filename (value )
@@ -229,6 +229,6 @@ def _list_outputs(self):
229
229
return outputs
230
230
231
231
232
- class AFNIPrefixOutputSpec (TraitedSpec ):
232
+ class AFNICommandOutputSpec (TraitedSpec ):
233
233
out_file = File (desc = 'output file' ,
234
234
exists = True )
0 commit comments