Skip to content

Commit 2b68b2c

Browse files
name_template for ToEcat interface.
The old code generated an output file in the directory of the input file, which is probably not how we want to do things. (Refer to Satra's comment about copyFile on the PR).
1 parent 64de4d6 commit 2b68b2c

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,10 @@ class ToEcatInputSpec(CommandLineInputSpec):
509509
mandatory=False,
510510
genfile=True,
511511
argstr='%s',
512-
position=-1,)
512+
position=-1,
513+
name_source=['input_file'],
514+
hash_files=False,
515+
name_template='%s_to_ecat.v')
513516

514517
ignore_patient_variable = traits.Bool(
515518
desc='Ignore informations from the minc patient variable.',
@@ -571,25 +574,6 @@ class ToEcat(CommandLine):
571574
output_spec = ToEcatOutputSpec
572575
_cmd = 'minctoecat'
573576

574-
def _gen_outfilename(self):
575-
"""
576-
If the user specified output_file then return that, otherwise
577-
return the full path to the input file with the extension
578-
changed to '.v'.
579-
"""
580-
581-
output_file = self.inputs.output_file
582-
583-
if isdefined(output_file):
584-
return output_file
585-
else:
586-
return os.path.splitext(self.inputs.input_file)[0] + '.v'
587-
588-
def _list_outputs(self):
589-
outputs = self.output_spec().get()
590-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
591-
return outputs
592-
593577

594578
class DumpInputSpec(StdOutCommandLineInputSpec):
595579
input_file = File(

0 commit comments

Comments
 (0)