Skip to content

Commit 412d479

Browse files
name template for Resample interface
1 parent 0483bf4 commit 412d479

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
@@ -2198,7 +2198,10 @@ class ResampleInputSpec(CommandLineInputSpec):
21982198
desc='output file',
21992199
genfile=True,
22002200
argstr='%s',
2201-
position=-1,)
2201+
position=-1,
2202+
name_source=['input_file'],
2203+
hash_files=False,
2204+
name_template='%s_resample.mnc')
22022205

22032206
# This is a dummy input.
22042207
input_grid_files = InputMultiPath(
@@ -2574,26 +2577,6 @@ class Resample(StdOutCommandLine):
25742577
output_spec = ResampleOutputSpec
25752578
_cmd = 'mincresample'
25762579

2577-
def _gen_filename(self, name):
2578-
if name == 'output_file':
2579-
output_file = self.inputs.output_file
2580-
2581-
if isdefined(output_file):
2582-
return os.path.abspath(output_file)
2583-
else:
2584-
return aggregate_filename(
2585-
[self.inputs.input_file], 'mincresample_output')
2586-
else:
2587-
raise NotImplemented
2588-
2589-
def _gen_outfilename(self):
2590-
return self._gen_filename('output_file')
2591-
2592-
def _list_outputs(self):
2593-
outputs = self.output_spec().get()
2594-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
2595-
return outputs
2596-
25972580

25982581
class NormInputSpec(CommandLineInputSpec):
25992582
"""

0 commit comments

Comments
 (0)