Skip to content

Commit 73c93be

Browse files
name template for Convert interface
1 parent 851f3d3 commit 73c93be

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ class ConvertInputSpec(CommandLineInputSpec):
382382
desc='output file',
383383
genfile=True,
384384
argstr='%s',
385-
position=-1,)
385+
position=-1,
386+
name_source=['input_file'],
387+
hash_files=False,
388+
name_template='%s_convert_output.mnc')
386389

387390
clobber = traits.Bool(
388391
desc='Overwrite existing file.',
@@ -441,26 +444,6 @@ class Convert(CommandLine):
441444
output_spec = ConvertOutputSpec
442445
_cmd = 'mincconvert'
443446

444-
def _gen_filename(self, name):
445-
if name == 'output_file':
446-
output_file = self.inputs.output_file
447-
448-
if isdefined(output_file):
449-
return os.path.abspath(output_file)
450-
else:
451-
return aggregate_filename(
452-
[self.inputs.input_file], 'convert_output')
453-
else:
454-
raise NotImplemented
455-
456-
def _gen_outfilename(self):
457-
return self._gen_filename('output_file')
458-
459-
def _list_outputs(self):
460-
outputs = self.output_spec().get()
461-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
462-
return outputs
463-
464447

465448
class CopyInputSpec(CommandLineInputSpec):
466449
input_file = File(

0 commit comments

Comments
 (0)