Skip to content

Commit 64de4d6

Browse files
name template for Copy interface
1 parent 73c93be commit 64de4d6

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
@@ -457,7 +457,10 @@ class CopyInputSpec(CommandLineInputSpec):
457457
desc='output file',
458458
genfile=True,
459459
argstr='%s',
460-
position=-1,)
460+
position=-1,
461+
name_source=['input_file'],
462+
hash_files=False,
463+
name_template='%s_copy.mnc')
461464

462465
_xor_pixel = ('pixel_values', 'real_values')
463466

@@ -492,26 +495,6 @@ class Copy(CommandLine):
492495
output_spec = CopyOutputSpec
493496
_cmd = 'minccopy'
494497

495-
def _gen_filename(self, name):
496-
if name == 'output_file':
497-
output_file = self.inputs.output_file
498-
499-
if isdefined(output_file):
500-
return os.path.abspath(output_file)
501-
else:
502-
return aggregate_filename(
503-
[self.inputs.input_file], 'copy_output')
504-
else:
505-
raise NotImplemented
506-
507-
def _gen_outfilename(self):
508-
return self._gen_filename('output_file')
509-
510-
def _list_outputs(self):
511-
outputs = self.output_spec().get()
512-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
513-
return outputs
514-
515498

516499
class ToEcatInputSpec(CommandLineInputSpec):
517500
input_file = File(

0 commit comments

Comments
 (0)