From bbe0b45ea296b358e3dff53d6706722d749b8960 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Wed, 28 Feb 2018 20:44:07 +0000 Subject: [PATCH] ensureIsImage works with file prefixes --- fsl/utils/ensure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fsl/utils/ensure.py b/fsl/utils/ensure.py index eb3368e4b..a2fd8d491 100644 --- a/fsl/utils/ensure.py +++ b/fsl/utils/ensure.py @@ -18,10 +18,13 @@ import six import nibabel as nib +import fsl.data.image as fslimage + def ensureIsImage(img): """Ensures that the given ``img`` is an in-memory ``nibabel`` object. """ if isinstance(img, six.string_types): + img = fslimage.addExt(img) img = nib.load(img) return img -- GitLab