19
19
from nipype .utils .filemanip import fname_presuffix
20
20
from .base import AFNICommand , AFNICommandInputSpec ,\
21
21
AFNICommandOutputSpec
22
+ from nipype .interfaces .base import CommandLineInputSpec , CommandLine
22
23
23
24
warn = warnings .warn
24
25
warnings .filterwarnings ('always' , category = UserWarning )
@@ -149,17 +150,14 @@ class TShift(AFNICommand):
149
150
output_spec = AFNICommandOutputSpec
150
151
151
152
152
- class RefitInputSpec (AFNICommandInputSpec ):
153
+ class RefitInputSpec (CommandLineInputSpec ):
153
154
in_file = File (desc = 'input file to 3drefit' ,
154
155
argstr = '%s' ,
155
156
position = - 1 ,
156
157
mandatory = True ,
157
158
exists = True ,
158
159
copyfile = True )
159
160
160
- out_file = File (name_template = "%s_refit" , desc = 'output image file name, should be the same as input' ,
161
- argstr = '%s' , name_source = "in_file" )
162
-
163
161
deoblique = traits .Bool (desc = 'replace current transformation' +
164
162
' matrix with cardinal matrix' ,
165
163
argstr = '-deoblique' )
@@ -173,7 +171,7 @@ class RefitInputSpec(AFNICommandInputSpec):
173
171
argstr = '-zorigin %s' )
174
172
175
173
176
- class Refit (AFNICommand ):
174
+ class Refit (CommandLine ):
177
175
"""Changes some of the information inside a 3D dataset's header
178
176
179
177
For complete details, see the `3drefit Documentation.
@@ -186,16 +184,20 @@ class Refit(AFNICommand):
186
184
>>> refit = afni.Refit()
187
185
>>> refit.inputs.in_file = 'structural.nii'
188
186
>>> refit.inputs.deoblique = True
189
- >>> refit.inputs.outputtype = "NIFTI_GZ"
190
187
>>> refit.cmdline
191
- '3drefit -deoblique structural_refit.nii.gz structural.nii'
188
+ '3drefit -deoblique structural.nii'
192
189
>>> res = refit.run() # doctest: +SKIP
193
190
194
191
"""
195
192
196
193
_cmd = '3drefit'
197
194
input_spec = RefitInputSpec
198
195
output_spec = AFNICommandOutputSpec
196
+
197
+ def _list_outputs (self ):
198
+ outputs = super (AFNICommand , self )._list_outputs ()
199
+ outputs ["out_file" ] = os .path .abspath (self .inputs .in_file )
200
+ return outputs
199
201
200
202
201
203
class WarpInputSpec (AFNICommandInputSpec ):
0 commit comments