From e6f95d468e08f5a30d8ef4d790547bb4aed3a746 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Thu, 12 Dec 2019 10:28:49 +0000
Subject: [PATCH] MNT: don't use get_data

---
 fsl/wrappers/wrapperutils.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fsl/wrappers/wrapperutils.py b/fsl/wrappers/wrapperutils.py
index c89afb2aa..81fb86826 100644
--- a/fsl/wrappers/wrapperutils.py
+++ b/fsl/wrappers/wrapperutils.py
@@ -952,16 +952,17 @@ def fileOrImage(*args, **kwargs):
 
         # create an independent in-memory
         # copy of the image file
-        img = nib.load(path, mmap=False)
+        img  = nib.load(path, mmap=False)
+        data = np.asanyarray(img.dataobj)
 
         # if any arguments were fsl images,
         # that takes precedence.
         if fslimage.Image in intypes:
-            return fslimage.Image(img.get_data(), header=img.header)
+            return fslimage.Image(data, header=img.header)
         # but if all inputs were file names,
         # nibabel takes precedence
         elif nib.nifti1.Nifti1Image in intypes or len(intypes) == 0:
-            return nib.nifti1.Nifti1Image(img.get_data(), None, img.header)
+            return nib.nifti1.Nifti1Image(data, None, img.header)
 
         # this function should not be called
         # under any other circumstances
-- 
GitLab