Skip to content
Snippets Groups Projects
Commit bbe0b45e authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

ensureIsImage works with file prefixes

parent e7f70760
No related branches found
No related tags found
No related merge requests found
...@@ -18,10 +18,13 @@ import six ...@@ -18,10 +18,13 @@ import six
import nibabel as nib import nibabel as nib
import fsl.data.image as fslimage
def ensureIsImage(img): def ensureIsImage(img):
"""Ensures that the given ``img`` is an in-memory ``nibabel`` object. """Ensures that the given ``img`` is an in-memory ``nibabel`` object.
""" """
if isinstance(img, six.string_types): if isinstance(img, six.string_types):
img = fslimage.addExt(img)
img = nib.load(img) img = nib.load(img)
return img return img
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment