Skip to content

Commit db825da

Browse files
authored
Merge pull request #2036 from mmodat/fix-hdr-copy
FIX hdr_copy in niftyseg BinaryMaths interface
2 parents cda3fdc + c79b7fb commit db825da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nipype/interfaces/niftyseg/maths.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,13 @@ def _format_arg(self, opt, spec, val):
361361
return super(BinaryMaths, self)._format_arg(opt, spec, val)
362362

363363
def _overload_extension(self, value, name=None):
364-
path = super(BinaryMaths, self)._overload_extension(value, name)
365364
if self.inputs.operation == 'hdr_copy':
365+
path, base, _ = split_filename(value)
366366
_, base, ext = split_filename(self.inputs.operand_file)
367367
suffix = self.inputs.operation
368-
path = os.path.join(path, '{0}{1}{2}'.format(base, suffix, ext))
369-
return path
368+
return os.path.join(path, '{0}{1}{2}'.format(base, suffix, ext))
369+
else:
370+
return super(BinaryMaths, self)._overload_extension(value, name)
370371

371372

372373
class BinaryMathsInputInteger(MathsInput):

0 commit comments

Comments
 (0)