From 6b34f4053aeed01d082caa029a5e3d22968e0320 Mon Sep 17 00:00:00 2001 From: Martin Craig <martin.craig@eng.ox.ac.uk> Date: Tue, 10 Jul 2018 13:17:07 +0100 Subject: [PATCH] Minor tweak: Only return images that exist in the output This allows @fileOrArray to be more liberal without returning a lot of key : None in the results. --- fsl/wrappers/wrapperutils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fsl/wrappers/wrapperutils.py b/fsl/wrappers/wrapperutils.py index a4ed4d4a7..cd59a55b8 100644 --- a/fsl/wrappers/wrapperutils.py +++ b/fsl/wrappers/wrapperutils.py @@ -577,11 +577,7 @@ class _FileOrThing(object): # Load the LOADed outputs for oname, ofile in outfiles.items(): - - if not op.exists(ofile): oval = None - else: oval = self.__load(ofile) - - result[oname] = oval + if op.exists(ofile): result[oname] = self.__load(ofile) return result -- GitLab