python-bioformats icon indicating copy to clipboard operation
python-bioformats copied to clipboard

Reading .jp2 files

Open jacobpennels opened this issue 8 years ago • 2 comments

I've been trying to use this library to read in a .jp2 image. However, the file is too big for it to handle. Bioformats has a solution for this under the open_bytes (?) function. How can I access this within this library?

Thanks

jacobpennels avatar Nov 08 '17 10:11 jacobpennels

Hi @jacobpennels assuming you are using the bioformats.ImageReader.read() API in your code, you should be able to pass a region using the XYWH key/value. This call effectively delegates to the low-level IFormatReader.openBytes API which returns a region of the specified dimensions rather than the entire plane.

NB: in the specific case of jp2 files, there is also a known issue for very large files recorded in https://trac.openmicroscopy.org/ome/ticket/9544.

sbesson avatar Nov 09 '17 16:11 sbesson

Thanks for your help, unfortunately the file I want to open falls into the very large category, therefore it leaves me a bit stuck. Thanks for pointing that out to me

jacobpennels avatar Nov 09 '17 16:11 jacobpennels