Skip to content

Commit ef25d15

Browse files
committed
RF: Use name_source for Allineate.inputs.out_file
1 parent 34f67b4 commit ef25d15

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ class AllineateInputSpec(AFNICommandInputSpec):
218218
out_file = File(
219219
desc='output file from 3dAllineate',
220220
argstr='-prefix %s',
221-
genfile=True,
221+
name_template='%s_allineate',
222+
name_source='in_file',
222223
hash_files=False,
223224
xor=['allcostx'])
224225
out_param_file = File(
@@ -486,16 +487,8 @@ def _format_arg(self, name, trait_spec, value):
486487
return arg
487488
return super(Allineate, self)._format_arg(name, trait_spec, value)
488489

489-
def _gen_outfilename(self):
490-
out_file = self.inputs.out_file
491-
if not isdefined(out_file) and isdefined(self.inputs.in_file) and not isdefined(self.inputs.allcostx):
492-
out_file = op.abspath(self._gen_fname(self.inputs.in_file,op.dirname(self.inputs.in_file),suffix='_allineate'))
493-
return out_file
494-
495490
def _list_outputs(self):
496-
outputs = self.output_spec().get()
497-
498-
outputs['out_file'] = self._gen_outfilename()
491+
outputs = super(Allineate, self)._list_outputs()
499492

500493
if isdefined(self.inputs.out_weight_file):
501494
outputs['out_weight_file'] = op.abspath(
@@ -523,11 +516,6 @@ def _list_outputs(self):
523516
os.path.join(os.getcwd(), self.inputs.allcostx))
524517
return outputs
525518

526-
def _gen_filename(self, name):
527-
if name == 'out_file':
528-
return self._gen_outfilename()
529-
return None
530-
531519

532520
class AutoTcorrelateInputSpec(AFNICommandInputSpec):
533521
in_file = File(

0 commit comments

Comments
 (0)