Skip to content

Commit ae7a618

Browse files
name template for Average interface
1 parent a18fb69 commit ae7a618

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
@@ -704,7 +704,10 @@ class AverageInputSpec(CommandLineInputSpec):
704704
desc='output file',
705705
genfile=True,
706706
argstr='%s',
707-
position=-1,)
707+
position=-1,
708+
name_source=['input_files'],
709+
hash_files=False,
710+
name_template='%s_averaged.mnc')
708711

709712
two = traits.Bool(desc='Create a MINC 2 output file.', argstr='-2')
710713

@@ -877,25 +880,6 @@ class Average(CommandLine):
877880
output_spec = AverageOutputSpec
878881
_cmd = 'mincaverage'
879882

880-
def _gen_filename(self, name):
881-
if name == 'output_file':
882-
output_file = self.inputs.output_file
883-
884-
if isdefined(output_file):
885-
return os.path.abspath(output_file)
886-
else:
887-
return aggregate_filename(self.inputs.input_files, 'averaged')
888-
else:
889-
raise NotImplemented
890-
891-
def _gen_outfilename(self):
892-
return self._gen_filename('output_file')
893-
894-
def _list_outputs(self):
895-
outputs = self.output_spec().get()
896-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
897-
return outputs
898-
899883

900884
class BlobInputSpec(CommandLineInputSpec):
901885
input_file = File(

0 commit comments

Comments
 (0)