Skip to content

Commit 7f6ff7c

Browse files
name template for BBox interface
1 parent 2c08958 commit 7f6ff7c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,11 @@ class BBoxInputSpec(StdOutCommandLineInputSpec):
11671167

11681168
output_file = File(
11691169
desc='output file containing bounding box corners',
1170-
position=-1)
1170+
position=-1,
1171+
name_source=['input_file'],
1172+
hash_files=False,
1173+
name_template='%s_bbox.txt',
1174+
keep_extension=False)
11711175

11721176
threshold = traits.Int(
11731177
0,
@@ -1227,20 +1231,6 @@ class BBox(StdOutCommandLine):
12271231
output_spec = BBoxOutputSpec
12281232
_cmd = 'mincbbox'
12291233

1230-
# FIXME Does this play nicely with a workflow?
1231-
def _gen_outfilename(self):
1232-
output_file = self.inputs.output_file
1233-
1234-
if isdefined(output_file):
1235-
return output_file
1236-
else:
1237-
return os.path.splitext(self.inputs.input_file)[0] + '_bbox.txt'
1238-
1239-
def _list_outputs(self):
1240-
outputs = self.output_spec().get()
1241-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
1242-
return outputs
1243-
12441234

12451235
class BeastInputSpec(CommandLineInputSpec):
12461236
"""

0 commit comments

Comments
 (0)