Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array too large Exception when using reader.read() #164

Open
nishantshakya opened this issue Sep 26, 2023 · 0 comments
Open

Array too large Exception when using reader.read() #164

nishantshakya opened this issue Sep 26, 2023 · 0 comments

Comments

@nishantshakya
Copy link

nishantshakya commented Sep 26, 2023

I have an RGB tif image of size of 107375 x 85902 x 1. There are other images as well in around 100K X 100K. For these images, I am getting this following exception:

 File "/lib/python3.8/site-packages/bioformats/formatreader.py", line 846, in read
    planes = [
  File "/lib/python3.8/site-packages/bioformats/formatreader.py", line 848, in <listcomp>
    (rdr.openBytes(rdr.getIndex(z,i,t)) if XYWH is None else
  File "/lib/python3.8/site-packages/javabridge/jutil.py", line 961, in method
    result = call(self.o, name, sig, *args)
  File "/lib/python3.8/site-packages/javabridge/jutil.py", line 892, in call
    result = fn(*nice_args)
  File "/lib/python3.8/site-packages/javabridge/jutil.py", line 859, in fn
    raise JavaException(x)
javabridge.jutil.JavaException: Array size too large: 107375 x 85902 x 1

Is there any limit on the size of the file that the library can load? Looks like its trying to load the image into an int byte array which can only support the images up to (w*h <= Integer.MAX_SIZE). I understand there's a way to get small boxes that can fit into memory and then join them for the export. I wanted to check if there's such support from the library itself.

 with bioformats.ImageReader(image) as reader:
        out[:, :, 0] = reader.read(c=0, z=0, t=0, rescale=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant