Skip to content

Commit 9cc8b14

Browse files
committed
Merge pull request #702 from chrisfilo/fix/afni_refit
fixed refit
2 parents bc10ead + 8f47a12 commit 9cc8b14

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from nipype.utils.filemanip import fname_presuffix
2020
from .base import AFNICommand, AFNICommandInputSpec,\
2121
AFNICommandOutputSpec
22+
from nipype.interfaces.base import CommandLineInputSpec, CommandLine
2223

2324
warn = warnings.warn
2425
warnings.filterwarnings('always', category=UserWarning)
@@ -149,17 +150,14 @@ class TShift(AFNICommand):
149150
output_spec = AFNICommandOutputSpec
150151

151152

152-
class RefitInputSpec(AFNICommandInputSpec):
153+
class RefitInputSpec(CommandLineInputSpec):
153154
in_file = File(desc='input file to 3drefit',
154155
argstr='%s',
155156
position=-1,
156157
mandatory=True,
157158
exists=True,
158159
copyfile=True)
159160

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-
163161
deoblique = traits.Bool(desc='replace current transformation' +
164162
' matrix with cardinal matrix',
165163
argstr='-deoblique')
@@ -173,7 +171,7 @@ class RefitInputSpec(AFNICommandInputSpec):
173171
argstr='-zorigin %s')
174172

175173

176-
class Refit(AFNICommand):
174+
class Refit(CommandLine):
177175
"""Changes some of the information inside a 3D dataset's header
178176
179177
For complete details, see the `3drefit Documentation.
@@ -186,16 +184,20 @@ class Refit(AFNICommand):
186184
>>> refit = afni.Refit()
187185
>>> refit.inputs.in_file = 'structural.nii'
188186
>>> refit.inputs.deoblique = True
189-
>>> refit.inputs.outputtype = "NIFTI_GZ"
190187
>>> refit.cmdline
191-
'3drefit -deoblique structural_refit.nii.gz structural.nii'
188+
'3drefit -deoblique structural.nii'
192189
>>> res = refit.run() # doctest: +SKIP
193190
194191
"""
195192

196193
_cmd = '3drefit'
197194
input_spec = RefitInputSpec
198195
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
199201

200202

201203
class WarpInputSpec(AFNICommandInputSpec):

0 commit comments

Comments
 (0)