From c79b7fba7db1654f8989be4fd500e02dadd96c31 Mon Sep 17 00:00:00 2001 From: byvernault Date: Fri, 19 May 2017 18:17:31 +0100 Subject: [PATCH] fixing hdr_copy overload extension where the path was not right. --- nipype/interfaces/niftyseg/maths.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/niftyseg/maths.py b/nipype/interfaces/niftyseg/maths.py index 3126a3788d..bd05ab5df3 100644 --- a/nipype/interfaces/niftyseg/maths.py +++ b/nipype/interfaces/niftyseg/maths.py @@ -361,12 +361,13 @@ def _format_arg(self, opt, spec, val): return super(BinaryMaths, self)._format_arg(opt, spec, val) def _overload_extension(self, value, name=None): - path = super(BinaryMaths, self)._overload_extension(value, name) if self.inputs.operation == 'hdr_copy': + path, base, _ = split_filename(value) _, base, ext = split_filename(self.inputs.operand_file) suffix = self.inputs.operation - path = os.path.join(path, '{0}{1}{2}'.format(base, suffix, ext)) - return path + return os.path.join(path, '{0}{1}{2}'.format(base, suffix, ext)) + else: + return super(BinaryMaths, self)._overload_extension(value, name) class BinaryMathsInputInteger(MathsInput):