Skip to content

Commit a9d73d6

Browse files
authored
Merge pull request #1669 from mgxd/fix/retroicor
fix: afni retroicor
2 parents b66ef0e + 3561708 commit a9d73d6

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

nipype/algorithms/tests/test_auto_FramewiseDisplacement.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def test_FramewiseDisplacement_inputs():
1111
ignore_exception=dict(nohash=True,
1212
usedefault=True,
1313
),
14-
in_plots=dict(),
14+
in_plots=dict(mandatory=True,
15+
),
1516
normalize=dict(usedefault=True,
1617
),
1718
out_figure=dict(usedefault=True,

nipype/algorithms/tests/test_auto_TSNR.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
22
from ...testing import assert_equal
3-
from ..misc import TSNR
3+
from ..confounds import TSNR
44

55

66
def test_TSNR_inputs():

nipype/interfaces/afni/preprocess.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3-
# vi: set ft = python sts = 4 ts = 4 sw = 4 et:
3+
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""Afni preprocessing interfaces
55
66
Change directory to provide relative paths for doctests
@@ -2384,7 +2384,9 @@ class RetroicorInputSpec(AFNICommandInputSpec):
23842384
mandatory=True,
23852385
exists=True,
23862386
copyfile=False)
2387-
out_file = File(desc='output image file name', argstr='-prefix %s', mandatory=True, position=1)
2387+
out_file = File(name_template='%s_retroicor', name_source=['in_file'],
2388+
desc='output image file name',
2389+
argstr='-prefix %s', position=1)
23882390
card = File(desc='1D cardiac data file for cardiac correction',
23892391
argstr='-card %s',
23902392
position=-2,
@@ -2438,6 +2440,7 @@ class Retroicor(AFNICommand):
24382440
>>> ret.inputs.in_file = 'functional.nii'
24392441
>>> ret.inputs.card = 'mask.1D'
24402442
>>> ret.inputs.resp = 'resp.1D'
2443+
>>> ret.inputs.outputtype = 'NIFTI'
24412444
>>> res = ret.run() # doctest: +SKIP
24422445
"""
24432446

@@ -2446,6 +2449,13 @@ class Retroicor(AFNICommand):
24462449
output_spec = AFNICommandOutputSpec
24472450

24482451

2452+
def _format_arg(self, name, trait_spec, value):
2453+
if name == 'in_file':
2454+
if not isdefined(self.inputs.card) and not isdefined(self.inputs.resp):
2455+
return None
2456+
return super(Retroicor, self)._format_arg(name, trait_spec, value)
2457+
2458+
24492459
class AFNItoNIFTIInputSpec(AFNICommandInputSpec):
24502460
in_file = File(desc='input file to 3dAFNItoNIFTI',
24512461
argstr='%s',

nipype/interfaces/afni/tests/test_auto_Retroicor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def test_Retroicor_inputs():
2828
position=-5,
2929
),
3030
out_file=dict(argstr='-prefix %s',
31-
mandatory=True,
31+
name_source=[u'in_file'],
32+
name_template='%s_retroicor',
3233
position=1,
3334
),
3435
outputtype=dict(),

0 commit comments

Comments
 (0)