Skip to content

Commit 0483bf4

Browse files
name template for Math interface
1 parent d8721d9 commit 0483bf4

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,10 @@ class MathInputSpec(CommandLineInputSpec):
17741774
desc='output file',
17751775
argstr='%s',
17761776
genfile=True,
1777-
position=-1)
1777+
position=-1,
1778+
name_source=['input_files'],
1779+
hash_files=False,
1780+
name_template='%s_mincmath.mnc')
17781781

17791782
filelist = traits.File(
17801783
desc='Specify the name of a file containing input file names.',
@@ -2173,27 +2176,6 @@ def _parse_inputs(self):
21732176

21742177
return super(Math, self)._parse_inputs()
21752178

2176-
def _gen_filename(self, name):
2177-
if name == 'output_file':
2178-
output_file = self.inputs.output_file
2179-
2180-
if isdefined(output_file):
2181-
return os.path.abspath(output_file)
2182-
else:
2183-
return aggregate_filename(
2184-
self.inputs.input_files,
2185-
'mincmath_output') + '.mnc'
2186-
else:
2187-
raise NotImplemented
2188-
2189-
def _gen_outfilename(self):
2190-
return self._gen_filename('output_file')
2191-
2192-
def _list_outputs(self):
2193-
outputs = self.output_spec().get()
2194-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
2195-
return outputs
2196-
21972179

21982180
class ResampleInputSpec(CommandLineInputSpec):
21992181
"""

0 commit comments

Comments
 (0)