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

MNT: don't use get_data

parent d8231fe2
No related branches found
No related tags found
No related merge requests found
...@@ -952,16 +952,17 @@ def fileOrImage(*args, **kwargs): ...@@ -952,16 +952,17 @@ def fileOrImage(*args, **kwargs):
# create an independent in-memory # create an independent in-memory
# copy of the image file # 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, # if any arguments were fsl images,
# that takes precedence. # that takes precedence.
if fslimage.Image in intypes: 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, # but if all inputs were file names,
# nibabel takes precedence # nibabel takes precedence
elif nib.nifti1.Nifti1Image in intypes or len(intypes) == 0: 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 # this function should not be called
# under any other circumstances # under any other circumstances
......
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