Skip to content

Fixed CopyInputSpecs to use positional inputs (added tests) #1131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2015
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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)
============
Expand Down
27 changes: 21 additions & 6 deletions nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion nipype/interfaces/afni/tests/test_auto_Copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down