diff --git a/.zenodo.json b/.zenodo.json index 1058e3b150..29e7f047ac 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -558,7 +558,7 @@ "name": "Flandin, Guillaume" }, { - "affiliation": "Stereotaxy Core, Brain & Spine Institute", + "affiliation": "University College London", "name": "P\u00e9rez-Garc\u00eda, Fernando", "orcid": "0000-0001-9090-3024" }, diff --git a/nipype/interfaces/niftyreg/regutils.py b/nipype/interfaces/niftyreg/regutils.py index 7c3ed28eaf..0910b7d65c 100644 --- a/nipype/interfaces/niftyreg/regutils.py +++ b/nipype/interfaces/niftyreg/regutils.py @@ -122,7 +122,7 @@ class RegResample(NiftyRegCommand): # Need this overload to properly constraint the interpolation type input def _format_arg(self, name, spec, value): if name == 'inter_val': - inter_val = {'NN': 0, 'LIN': 1, 'CUB': 3, 'SINC': 5} + inter_val = {'NN': 0, 'LIN': 1, 'CUB': 3, 'SINC': 4} return spec.argstr % inter_val[value] else: return super(RegResample, self)._format_arg(name, spec, value) @@ -295,6 +295,15 @@ class RegToolsInputSpec(NiftyRegCommandInputSpec): desc=desc, argstr='-smoG %f %f %f') + # Interpolation type + inter_val = traits.Enum( + 'NN', + 'LIN', + 'CUB', + 'SINC', + desc='Interpolation order to use to warp the floating image', + argstr='-interp %d') + class RegToolsOutputSpec(TraitedSpec): """ Output Spec for RegTools. """ @@ -326,6 +335,14 @@ class RegTools(NiftyRegCommand): output_spec = RegToolsOutputSpec _suffix = '_tools' + # Need this overload to properly constraint the interpolation type input + def _format_arg(self, name, spec, value): + if name == 'inter_val': + inter_val = {'NN': 0, 'LIN': 1, 'CUB': 3, 'SINC': 4} + return spec.argstr % inter_val[value] + else: + return super(RegTools, self)._format_arg(name, spec, value) + class RegAverageInputSpec(NiftyRegCommandInputSpec): """ Input Spec for RegAverage. """ diff --git a/nipype/interfaces/niftyreg/tests/test_auto_RegTools.py b/nipype/interfaces/niftyreg/tests/test_auto_RegTools.py index 97ea5e6c92..f0f66083c7 100644 --- a/nipype/interfaces/niftyreg/tests/test_auto_RegTools.py +++ b/nipype/interfaces/niftyreg/tests/test_auto_RegTools.py @@ -24,6 +24,7 @@ def test_RegTools_inputs(): argstr='-in %s', mandatory=True, ), + inter_val=dict(argstr='-interp %d', ), iso_flag=dict(argstr='-iso', ), mask_file=dict(argstr='-nan %s', ), mul_val=dict(argstr='-mul %s', ),