Skip to content

Commit 168f948

Browse files
committed
changed out_file to positional input and added new tests
1 parent a23d402 commit 168f948

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ class CopyInputSpec(AFNICommandInputSpec):
676676
exists=True,
677677
copyfile=False)
678678
out_file = File(name_template="%s_copy", desc='output image file name',
679-
argstr='-prefix %s', name_source="in_file")
679+
argstr='%s', position=-1, name_source="in_file")
680680

681681

682682
class Copy(AFNICommand):
@@ -690,11 +690,26 @@ class Copy(AFNICommand):
690690
========
691691
692692
>>> from nipype.interfaces import afni as afni
693-
>>> copy = afni.Copy()
694-
>>> copy.inputs.in_file = 'functional.nii'
695-
>>> copy.inputs.out_file = 'new_func.nii'
696-
>>> res = copy.run() # doctest: +SKIP
697-
693+
>>> copy3d = afni.Copy()
694+
>>> copy3d.inputs.in_file = 'functional.nii'
695+
>>> copy3d.cmdline
696+
'3dcopy functional.nii functional_copy'
697+
698+
>>> from copy import deepcopy
699+
>>> copy3d_2 = deepcopy(copy3d)
700+
>>> copy3d_2.inputs.outputtype = 'NIFTI'
701+
>>> copy3d_2.cmdline
702+
'3dcopy functional.nii functional_copy.nii'
703+
704+
>>> copy3d_3 = deepcopy(copy3d)
705+
>>> copy3d_3.inputs.outputtype = 'NIFTI_GZ'
706+
>>> copy3d_3.cmdline
707+
'3dcopy functional.nii functional_copy.nii.gz'
708+
709+
>>> copy3d_4 = deepcopy(copy3d)
710+
>>> copy3d_4.inputs.out_file = 'new_func.nii'
711+
>>> copy3d_4.cmdline
712+
'3dcopy functional.nii new_func.nii'
698713
"""
699714

700715
_cmd = '3dcopy'

0 commit comments

Comments
 (0)