Update imgData endpoint to return more metadata about the resolutions#653
Conversation
The response to this endpoint uses `ImageWrapper.getZoomLevelScaling` which reduces the resolution description as a one dimensional array of scalar zoom levels. This reduction suffers from limitations both due to rounding errors as well as resolution levels where sizeX and sizeY might have different zoom level scaling. This commit marshals the sizeX/sizeY pair returned from PixelBuffer.getResolutionDescriptions into a new dictionary for all resolutions and returns it as an additional `resolutions` field in the JSON response for multi-resolution images.
|
Once the initial draft has been validated by the nightly CI builds to confirm there is no regression, the plan is to extend the https://github.com/ome/openmicroscopy/blob/develop/components/tools/OmeroWeb/test/integration/test_marshal.py integration. test to cover the multi-resolution scenario in addition to the simple small multi-dimensional image. |
|
Will this change the behavior of Clients that check for the existence of a Could we alternatively keep the current |
|
No, the intent of this is to be 100% backwards-compatible although My reading of the current implementation is that for single-resolution images, the omero-web/omeroweb/webgateway/marshal.py Lines 183 to 186 in 1c82ac1 |
|
The test has I understand we don't want to call |
After another reading I agree, the presence of |
|
Tests are green |
Fixes #584
The response to the
webgateway/imgDataendpoint usesImageWrapper.getZoomLevelScalingwhich reduces the resolution description as a one dimensional array of scalar zoom levels.This reduction suffers from limitations both due to rounding errors as well as resolution levels where sizeX and sizeY might have different zoom level scaling.
This commit marshals the sizeX/sizeY pair returned from PixelBuffer.getResolutionDescriptions into a new dictionary for all resolutions and returns it as an additional
resolutionsfield in the JSON response for multi-resolution images.The proposed value of the
resolutionsattribute mirrorszoomLevelScalingby using a dictionary where each key is the resolution index and only being populated for images with more than one resolution. As a possible discussion point,resolutionscould be populated for all images independently of the number of resolution level./cc @melissalinkert @kkoz