I'm trying to open a zipped nifty file using nibabel library (as nib) and the following code:
img = nib.load (nifti_file)
img_data = img.get_data ()
where nifti_file
is a variable with the path to the file in the same directory.
On the second line, there is an out-of-memory error that happens 60% of the time randomly while I try running those two lines. I have enough memory space on my computer so I'm not sure why this happens and also as I mentioned sometimes it simply works.