diff --git a/CHANGES b/CHANGES index 0d83322688..0554b9fbbb 100644 --- a/CHANGES +++ b/CHANGES @@ -56,6 +56,7 @@ Next release * FIX: Add QA output for TSNR to resting workflow (https://github.com/nipy/nipype/pull/1088) * FIX: Change N4BiasFieldCorrection to use short tag for dimensionality (backward compatible) (https://github.com/nipy/nipype/pull/1096) * ENH: Added -newgrid input to Warp in AFNI (3dWarp wrapper) (https://github.com/nipy/nipype/pull/1128) +* FIX: Fixed AFNI Copy interface to use positional inputs as required (https://github.com/nipy/nipype/pull/1131) Release 0.10.0 (October 10, 2014) ============ diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 09ae84a474..b3038ee62b 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -676,7 +676,7 @@ class CopyInputSpec(AFNICommandInputSpec): exists=True, copyfile=False) out_file = File(name_template="%s_copy", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + argstr='%s', position=-1, name_source="in_file") class Copy(AFNICommand): @@ -690,11 +690,26 @@ class Copy(AFNICommand): ======== >>> from nipype.interfaces import afni as afni - >>> copy = afni.Copy() - >>> copy.inputs.in_file = 'functional.nii' - >>> copy.inputs.out_file = 'new_func.nii' - >>> res = copy.run() # doctest: +SKIP - + >>> copy3d = afni.Copy() + >>> copy3d.inputs.in_file = 'functional.nii' + >>> copy3d.cmdline + '3dcopy functional.nii functional_copy' + + >>> from copy import deepcopy + >>> copy3d_2 = deepcopy(copy3d) + >>> copy3d_2.inputs.outputtype = 'NIFTI' + >>> copy3d_2.cmdline + '3dcopy functional.nii functional_copy.nii' + + >>> copy3d_3 = deepcopy(copy3d) + >>> copy3d_3.inputs.outputtype = 'NIFTI_GZ' + >>> copy3d_3.cmdline + '3dcopy functional.nii functional_copy.nii.gz' + + >>> copy3d_4 = deepcopy(copy3d) + >>> copy3d_4.inputs.out_file = 'new_func.nii' + >>> copy3d_4.cmdline + '3dcopy functional.nii new_func.nii' """ _cmd = '3dcopy' diff --git a/nipype/interfaces/afni/tests/test_auto_Copy.py b/nipype/interfaces/afni/tests/test_auto_Copy.py index 303fed93fd..b9d7741d63 100644 --- a/nipype/interfaces/afni/tests/test_auto_Copy.py +++ b/nipype/interfaces/afni/tests/test_auto_Copy.py @@ -16,9 +16,10 @@ def test_Copy_inputs(): mandatory=True, position=-2, ), - out_file=dict(argstr='-prefix %s', + out_file=dict(argstr='%s', name_source='in_file', name_template='%s_copy', + position=-1, ), outputtype=dict(), terminal_output=dict(nohash=True,