Skip to content

Commit 5349ad4

Browse files
author
bpinsard
committed
each time I use an afni interface I have not been using for a long time I spend 4 hours fixing some bugs that goes down to base interface specs......
1 parent f1d3e94 commit 5349ad4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nipype/interfaces/afni/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,11 @@ def _gen_filename(self, name):
217217
_, base, _ = split_filename(
218218
getattr(self.inputs, trait_spec.name_source))
219219
return self._gen_fname(basename=base, prefix=prefix, suffix=suffix, cwd=os.getcwd())
220+
220221
else:
221-
return os.path.join(os.getcwd(),
222-
super(AFNICommand, self)._gen_filename(name))
222+
if getattr(self.inputs, name):
223+
return os.path.join(
224+
os.getcwd(),super(AFNICommand, self)._gen_filename(name))
223225

224226
def _overload_extension(self, value):
225227
path, base, _ = split_filename(value)
@@ -232,7 +234,7 @@ def _list_outputs(self):
232234
outputs = self.output_spec().get()
233235
for name in out_names:
234236
out = self._gen_filename(name)
235-
if isdefined(out):
237+
if out and isdefined(out):
236238
outputs[name] = os.path.abspath(out)
237239
return outputs
238240

0 commit comments

Comments
 (0)