Skip to content

FIX hdr_copy in niftyseg BinaryMaths interface #2036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions nipype/interfaces/niftyseg/maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down