bioformats
bioformats copied to clipboard
OIRReader: Major performance improvement when reading a ROI within a plane
In the implementation before this PR each time a small ROI is read from an image, a full OIR Pixelblock was read. Combined with the fact that the Optimal Tile Size was not overriden and defaulted to a thin stripe in y (128 pixels), this could lead to a particularly bad scenario for big images:
- Imagine a 10000 by 10000 pixel plane read by tiles of 10000x128 pixels -> 79 tiles have to be read to read the full plane
- For big tiled OIR images, a PixelBlock typically spans the full plane
- This means that, to acquire all tiles of this plane, the full plane is actually read 97 times
The proposed new implementation of this PR:
- prevents reading fully all PixelBlocks when one needs to read a ROI within them
- overrides getOptimalTile size methods to match the underlying PixelBlock size (or crops at 2048 pixels)
When requesting a cropped region within big images, the speedup is massive.
Here's a real time display with big dataviewer with the current implementation:
Here's a real time display with big dataviewer with the implementation in this PR: