Skip to content

Commit 2c08958

Browse files
name template for Calc interface
1 parent 5c4a618 commit 2c08958

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,10 @@ class CalcInputSpec(CommandLineInputSpec):
950950
desc='output file',
951951
genfile=True,
952952
argstr='%s',
953-
position=-1,)
953+
position=-1,
954+
name_source=['input_files'],
955+
hash_files=False,
956+
name_template='%s_calc.mnc')
954957

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

@@ -1145,26 +1148,6 @@ class Calc(CommandLine):
11451148
output_spec = CalcOutputSpec
11461149
_cmd = 'minccalc'
11471150

1148-
def _gen_filename(self, name):
1149-
if name == 'output_file':
1150-
output_file = self.inputs.output_file
1151-
1152-
if isdefined(output_file):
1153-
return os.path.abspath(output_file)
1154-
else:
1155-
return aggregate_filename(
1156-
[self.inputs.input_file], 'calc_output')
1157-
else:
1158-
raise NotImplemented
1159-
1160-
def _gen_outfilename(self):
1161-
return self._gen_filename('output_file')
1162-
1163-
def _list_outputs(self):
1164-
outputs = self.output_spec().get()
1165-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
1166-
return outputs
1167-
11681151

11691152
# FIXME mincbbox produces output like
11701153
#

0 commit comments

Comments
 (0)