Skip to content

Commit e2928a5

Browse files
author
bpinsard
committed
fixing Automask
1 parent 94b7262 commit e2928a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import os
1313
from .base import AFNIBaseCommandInputSpec, AFNIBaseCommand
1414
from ..base import (Directory, CommandLineInputSpec, CommandLine, TraitedSpec,
15-
traits, isdefined, File, InputMultiPath)
15+
traits, isdefined, File, InputMultiPath, Undefined)
1616
from ...utils.filemanip import (load_json, save_json, split_filename)
1717
from nipype.utils.filemanip import fname_presuffix
1818
from nipype.interfaces.afni.base import AFNICommand, AFNICommandInputSpec,\
@@ -553,8 +553,9 @@ def _gen_filename(self, name):
553553
_, base, _ = split_filename(
554554
getattr(self.inputs, trait_spec.name_source))
555555
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
558559

559560
def _list_outputs(self):
560561
outputs = super(Automask, self)._list_outputs()

0 commit comments

Comments
 (0)