Skip to content

Commit d9ca533

Browse files
name template for Norm interface
1 parent 412d479 commit d9ca533

File tree

1 file changed

+7
-32
lines changed

1 file changed

+7
-32
lines changed

nipype/interfaces/minc/minc.py

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,12 +2603,17 @@ class NormInputSpec(CommandLineInputSpec):
26032603
desc='output file',
26042604
genfile=True,
26052605
argstr='%s',
2606-
position=-1,)
2606+
position=-1,
2607+
name_source=['input_file'],
2608+
hash_files=False,
2609+
name_template='%s_norm.mnc')
26072610

26082611
output_threshold_mask = traits.File(
26092612
desc='File in which to store the threshold mask.',
26102613
argstr='-threshold_mask %s',
2611-
genfile=True)
2614+
name_source=['input_file'],
2615+
hash_files=False,
2616+
name_template='%s_norm_threshold_mask.mnc')
26122617

26132618
clobber = traits.Bool(
26142619
desc='Overwrite existing file.',
@@ -2686,36 +2691,6 @@ class Norm(CommandLine):
26862691
output_spec = NormOutputSpec
26872692
_cmd = 'mincnorm'
26882693

2689-
def _gen_filename(self, name):
2690-
if name == 'output_file':
2691-
output_file = self.inputs.output_file
2692-
2693-
if isdefined(output_file):
2694-
return os.path.abspath(output_file)
2695-
else:
2696-
return aggregate_filename(
2697-
[self.inputs.input_file], 'norm_output')
2698-
elif name == 'output_threshold_mask':
2699-
output_threshold_mask = self.inputs.output_threshold_mask
2700-
2701-
if isdefined(output_threshold_mask):
2702-
return os.path.abspath(output_threshold_mask)
2703-
else:
2704-
return aggregate_filename(
2705-
[self.inputs.input_file], 'norm_output_threshold_mask')
2706-
else:
2707-
raise NotImplemented
2708-
2709-
def _gen_outfilename(self):
2710-
return self._gen_filename('output_file')
2711-
2712-
def _list_outputs(self):
2713-
outputs = self.output_spec().get()
2714-
outputs['output_file'] = os.path.abspath(self._gen_outfilename())
2715-
outputs['output_threshold_mask'] = self._gen_filename(
2716-
'output_threshold_mask')
2717-
return outputs
2718-
27192694

27202695
"""
27212696
| volcentre will centre a MINC image's sampling about a point (0,0,0 typically)

0 commit comments

Comments
 (0)