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

Improve the resolution descriptions of the imgData endpoint #584

Open
sbesson opened this issue Oct 3, 2024 · 0 comments
Open

Improve the resolution descriptions of the imgData endpoint #584

sbesson opened this issue Oct 3, 2024 · 0 comments

Comments

@sbesson
Copy link
Member

sbesson commented Oct 3, 2024

Bio-Formats and OMERO introduced the ability to work natively with multi-resolution file formats 12 years ago. See notably the PR introducing the sub-resolution API in Bio-Formats 1 and in OMERO 2. In OMERO.web in particular, the return value of PixelBuffer.getResolutionDescriptions() is getting converted into a 1D array of floating point values representing the zoom level scaling computed as the ratio of the sizeX for the current resolution divided by the sizeX of the largest resolution and this zoomLevelScaling list is exposed in the webclient/imgData endpoint of OMERO.web 3.

The approach above has been working quite successfully for the last 12 years and provides an simple representation of the resolution levels available for a given image. In the scenario where the image is downsampled uniformly according to a scale factor without rounding issues e.g. [48000,24000], [12000,6000], [3000,1500], [750,375], this 1D representation is sufficient.
However we have been recently exposed to limitations of this representation in the scenarios where:

  • the ratio between zoom level can be represented exactly as a decimal number e.g. scaleFactor of 3 or dimensions that do not divide exactly into an integer
  • there is some anisotropy in the X vs Y downsampling for certain resolution levels

In these scenarios, computing the sizes of each resolution using the size of the largest resolution (i.e. the sizeX and sizeZ) and the knowledge of the zoomLevelScaling can easily lead to off-by-one (or more) errors in the sizeY 4. This is problematic as the computed resolution dimensions are translated into tile requests which in turn exceed the effective dimensions.

From a quick investigation of mathematical workaround, there is no canonical way to fix all scenarios using the current API. Instead a more robust approach would be to update the webclient/imgData endpoint and return a new field that marshals and exposes the fullness of PixelBuffer.getResolutionDescriptions() including the sizes alongside each dimension for each resolution level. If available, clients including the OMERO.web viewers should be able to consume these dimensions directly rather than recomputing them internally and make the appropriate requests

Footnotes

  1. https://github.com/ome/bioformats/pull/118

  2. https://github.com/ome/openmicroscopy/pull/634

  3. https://github.com/ome/omero-web/commit/4c8de98a6e24eb671474681729e7d73aa394102f

  4. https://github.com/glencoesoftware/qupath-extension-omero-web/issues/8

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