Skip to content

Commit a18fb69

Browse files
name template for Dump interface
1 parent a725ce4 commit a18fb69

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,11 @@ class DumpInputSpec(StdOutCommandLineInputSpec):
586586

587587
output_file = File(
588588
desc='output file',
589-
position=-1)
589+
position=-1,
590+
name_source=['input_file'],
591+
hash_files=False,
592+
name_template='%s_dump.txt',
593+
keep_extension=False)
590594

591595
_xor_coords_or_header = ('coordinate_data', 'header_data',)
592596

@@ -675,25 +679,6 @@ def _format_arg(self, name, spec, value):
675679
raise ValueError('Invalid precision argument: ' + str(value))
676680
return super(Dump, self)._format_arg(name, spec, value)
677681

678-
def _gen_outfilename(self):
679-
"""
680-
If the user specified output_file then return that, otherwise
681-
return the full path to the input file with the extension
682-
changed to '.txt'.
683-
"""
684-
685-
output_file = self.inputs.output_file
686-
687-
if isdefined(output_file):
688-
return output_file
689-
else:
690-
return os.path.splitext(self.inputs.input_file)[0] + '.txt'
691-
692-
def _list_outputs(self):
693-
outputs = self.output_spec().get()
694-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
695-
return outputs
696-
697682

698683
class AverageInputSpec(CommandLineInputSpec):
699684
_xor_input_files = ('input_files', 'filelist')

0 commit comments

Comments
 (0)