diff --git a/nipype/algorithms/tests/test_auto_FramewiseDisplacement.py b/nipype/algorithms/tests/test_auto_FramewiseDisplacement.py index ce12c6f4fa..98450d8a64 100644 --- a/nipype/algorithms/tests/test_auto_FramewiseDisplacement.py +++ b/nipype/algorithms/tests/test_auto_FramewiseDisplacement.py @@ -11,7 +11,8 @@ def test_FramewiseDisplacement_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - in_plots=dict(), + in_plots=dict(mandatory=True, + ), normalize=dict(usedefault=True, ), out_figure=dict(usedefault=True, diff --git a/nipype/algorithms/tests/test_auto_TSNR.py b/nipype/algorithms/tests/test_auto_TSNR.py index 4bc6693b20..92d39721ae 100644 --- a/nipype/algorithms/tests/test_auto_TSNR.py +++ b/nipype/algorithms/tests/test_auto_TSNR.py @@ -1,6 +1,6 @@ # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ...testing import assert_equal -from ..misc import TSNR +from ..confounds import TSNR def test_TSNR_inputs(): diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 59ae5e0398..9f760a98e3 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- -# vi: set ft = python sts = 4 ts = 4 sw = 4 et: +# vi: set ft=python sts=4 ts=4 sw=4 et: """Afni preprocessing interfaces Change directory to provide relative paths for doctests @@ -2384,7 +2384,9 @@ class RetroicorInputSpec(AFNICommandInputSpec): mandatory=True, exists=True, copyfile=False) - out_file = File(desc='output image file name', argstr='-prefix %s', mandatory=True, position=1) + out_file = File(name_template='%s_retroicor', name_source=['in_file'], + desc='output image file name', + argstr='-prefix %s', position=1) card = File(desc='1D cardiac data file for cardiac correction', argstr='-card %s', position=-2, @@ -2438,6 +2440,7 @@ class Retroicor(AFNICommand): >>> ret.inputs.in_file = 'functional.nii' >>> ret.inputs.card = 'mask.1D' >>> ret.inputs.resp = 'resp.1D' + >>> ret.inputs.outputtype = 'NIFTI' >>> res = ret.run() # doctest: +SKIP """ @@ -2446,6 +2449,13 @@ class Retroicor(AFNICommand): output_spec = AFNICommandOutputSpec + def _format_arg(self, name, trait_spec, value): + if name == 'in_file': + if not isdefined(self.inputs.card) and not isdefined(self.inputs.resp): + return None + return super(Retroicor, self)._format_arg(name, trait_spec, value) + + class AFNItoNIFTIInputSpec(AFNICommandInputSpec): in_file = File(desc='input file to 3dAFNItoNIFTI', argstr='%s', diff --git a/nipype/interfaces/afni/tests/test_auto_Retroicor.py b/nipype/interfaces/afni/tests/test_auto_Retroicor.py index 2d5fb74175..e80c138b7d 100644 --- a/nipype/interfaces/afni/tests/test_auto_Retroicor.py +++ b/nipype/interfaces/afni/tests/test_auto_Retroicor.py @@ -28,7 +28,8 @@ def test_Retroicor_inputs(): position=-5, ), out_file=dict(argstr='-prefix %s', - mandatory=True, + name_source=[u'in_file'], + name_template='%s_retroicor', position=1, ), outputtype=dict(),