Skip to content

Commit 1c845f6

Browse files
ShotgunosineDylan
authored andcommitted
[ENH] add overwite option to Calc interface
1 parent 7b55585 commit 1c845f6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

nipype/interfaces/afni/utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ class CalcInputSpec(AFNICommandInputSpec):
391391
requires=['start_idx'])
392392
single_idx = traits.Int(
393393
desc='volume index for in_file_a')
394+
overwrite = traits.Bool(
395+
desc='overwrite output',
396+
argstr='-overwrite')
394397
other = File(
395398
desc='other options',
396399
argstr='')
@@ -416,6 +419,16 @@ class Calc(AFNICommand):
416419
'3dcalc -a functional.nii -b functional2.nii -expr "a*b" -prefix functional_calc.nii.gz'
417420
>>> res = calc.run() # doctest: +SKIP
418421
422+
>>> from nipype.interfaces import afni
423+
>>> calc = afni.Calc()
424+
>>> calc.inputs.in_file_a = 'functional.nii'
425+
>>> calc.inputs.expr = '1'
426+
>>> calc.inputs.out_file = 'rm.epi.all1'
427+
>>> calc.inputs.overwrite = True
428+
>>> calc.cmdline # doctest: +ALLOW_UNICODE
429+
'3dcalc -a functional.nii -expr "1" -prefix rm.epi.all1 -overwrite'
430+
>>> res = calc.run() # doctest: +SKIP
431+
419432
"""
420433

421434
_cmd = '3dcalc'

0 commit comments

Comments
 (0)