Skip to content

Commit 0b07706

Browse files
output template for Extract interface
1 parent b92d0f8 commit 0b07706

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ class ExtractInputSpec(StdOutCommandLineInputSpec):
7373

7474
output_file = File(
7575
desc='output file',
76-
position=-1)
76+
position=-1,
77+
name_source=['input_file'],
78+
hash_files=False,
79+
name_template='%s.raw',
80+
keep_extension=False)
7781

7882
_xor_write = ('write_ascii', 'write_ascii', 'write_byte',
7983
'write_short', 'write_int', 'write_long',
@@ -260,26 +264,6 @@ class Extract(StdOutCommandLine):
260264
output_spec = ExtractOutputSpec
261265
_cmd = 'mincextract'
262266

263-
# FIXME Does this play nicely with a workflow?
264-
def _gen_outfilename(self):
265-
"""
266-
If the user specified output_file then return that, otherwise
267-
return the full path to the input file with the extension
268-
changed to '.raw'.
269-
"""
270-
271-
output_file = self.inputs.output_file
272-
273-
if isdefined(output_file):
274-
return output_file
275-
else:
276-
return os.path.splitext(self.inputs.input_file)[0] + '.raw'
277-
278-
def _list_outputs(self):
279-
outputs = self.output_spec().get()
280-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
281-
return outputs
282-
283267

284268
class ToRawInputSpec(StdOutCommandLineInputSpec):
285269
input_file = File(

0 commit comments

Comments
 (0)