Skip to content

Commit 851f3d3

Browse files
Output template for ToRaw interface.
1 parent 0b07706 commit 851f3d3

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
@@ -275,7 +275,11 @@ class ToRawInputSpec(StdOutCommandLineInputSpec):
275275

276276
output_file = File(
277277
desc='output file',
278-
position=-1)
278+
position=-1,
279+
name_source=['input_file'],
280+
hash_files=False,
281+
name_template='%s.raw',
282+
keep_extension=False)
279283

280284
_xor_write = ('write_byte', 'write_short', 'write_int',
281285
'write_long', 'write_float', 'write_double')
@@ -365,25 +369,6 @@ class ToRaw(StdOutCommandLine):
365369
output_spec = ToRawOutputSpec
366370
_cmd = 'minctoraw'
367371

368-
def _gen_outfilename(self):
369-
"""
370-
If the user specified output_file then return that, otherwise
371-
return the full path to the input file with the extension
372-
changed to '.raw'.
373-
"""
374-
375-
output_file = self.inputs.output_file
376-
377-
if isdefined(output_file):
378-
return output_file
379-
else:
380-
return os.path.splitext(self.inputs.input_file)[0] + '.raw'
381-
382-
def _list_outputs(self):
383-
outputs = self.output_spec().get()
384-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
385-
return outputs
386-
387372

388373
class ConvertInputSpec(CommandLineInputSpec):
389374
input_file = File(

0 commit comments

Comments
 (0)