|
12 | 12 | import os
|
13 | 13 | from .base import AFNIBaseCommandInputSpec, AFNIBaseCommand
|
14 | 14 | from ..base import (Directory, CommandLineInputSpec, CommandLine, TraitedSpec,
|
15 |
| - traits, isdefined, File, InputMultiPath) |
| 15 | + traits, isdefined, File, InputMultiPath, Undefined) |
16 | 16 | from ...utils.filemanip import (load_json, save_json, split_filename)
|
17 | 17 | from nipype.utils.filemanip import fname_presuffix
|
18 | 18 | from nipype.interfaces.afni.base import AFNICommand, AFNICommandInputSpec,\
|
@@ -553,8 +553,9 @@ def _gen_filename(self, name):
|
553 | 553 | _, base, _ = split_filename(
|
554 | 554 | getattr(self.inputs, trait_spec.name_source))
|
555 | 555 | return self._gen_fname(basename=base, prefix=prefix, suffix=suffix, cwd='')
|
556 |
| - else: |
557 |
| - return super(AFNICommand, self)._gen_filename(name) |
| 556 | + elif hasattr(self.inputs,name) and isdefined(getattr(self.inputs,name)): |
| 557 | + return super(Automask, self)._gen_filename(name) |
| 558 | + return Undefined |
558 | 559 |
|
559 | 560 | def _list_outputs(self):
|
560 | 561 | outputs = super(Automask, self)._list_outputs()
|
|
0 commit comments