Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from nipype.utils.filemanip import fname_presuffix
from .base import AFNICommand, AFNICommandInputSpec,\
AFNICommandOutputSpec
from nipype.interfaces.base import CommandLineInputSpec, CommandLine

warn = warnings.warn
warnings.filterwarnings('always', category=UserWarning)
Expand Down Expand Up @@ -149,17 +150,14 @@ class TShift(AFNICommand):
output_spec = AFNICommandOutputSpec


class RefitInputSpec(AFNICommandInputSpec):
class RefitInputSpec(CommandLineInputSpec):
in_file = File(desc='input file to 3drefit',
argstr='%s',
position=-1,
mandatory=True,
exists=True,
copyfile=True)

out_file = File(name_template="%s_refit", desc='output image file name, should be the same as input',
argstr='%s', name_source="in_file")

deoblique = traits.Bool(desc='replace current transformation' +
' matrix with cardinal matrix',
argstr='-deoblique')
Expand All @@ -173,7 +171,7 @@ class RefitInputSpec(AFNICommandInputSpec):
argstr='-zorigin %s')


class Refit(AFNICommand):
class Refit(CommandLine):
"""Changes some of the information inside a 3D dataset's header

For complete details, see the `3drefit Documentation.
Expand All @@ -186,16 +184,20 @@ class Refit(AFNICommand):
>>> refit = afni.Refit()
>>> refit.inputs.in_file = 'structural.nii'
>>> refit.inputs.deoblique = True
>>> refit.inputs.outputtype = "NIFTI_GZ"
>>> refit.cmdline
'3drefit -deoblique structural_refit.nii.gz structural.nii'
'3drefit -deoblique structural.nii'
>>> res = refit.run() # doctest: +SKIP

"""

_cmd = '3drefit'
input_spec = RefitInputSpec
output_spec = AFNICommandOutputSpec

def _list_outputs(self):
outputs = super(AFNICommand, self)._list_outputs()
outputs["out_file"] = os.path.abspath(self.inputs.in_file)
return outputs


class WarpInputSpec(AFNICommandInputSpec):
Expand Down