Conversation
When we adjusst rendering settings, right panel and figure panel both render at the same time. We don't want to duplicate loading of chunks, so if the request is already pending, wait for it to complete the use the cached value
Not sure about the latter. I guess the best would be to upload the script from #662 to merge-ci ? Edit: I went ahead and uploaded the script from #662 to merge-ci. A problem reported on #662 (comment) |
@will-moore thanks for the confirmation. +1 for the check (i.e. the user does not get exposed to the techy error). But I guess the user will appreciate more a hint about how to get to single images which are viewable in Figure ? (maybe wanting too much, or maybe the validator will give a hint ?) |
|
@pwalczysko I added handling for bf2raw images, plates, 404s etc.
In ngff-validator, you can actually copy a single Image URL by clicking on the Mobie icon. I guess I could add a dedicated "Copy URL" button too. For Labels from KVPs and Tags, the zarr images now behave the same as OMERO images without Tags/KVPs. Thnaks for testing the export script. I'll have a look at that once this PR is looking good. |
|
Conflicting PR. Removed from build OMERO-plugins-push#38. See the console output for more details.
|
|
Re-tested. All works fine. But the script in the #662 has problems. @Tom-TBT do you want to have a look at the improvements you asked for ? I can see that imho your insert-in-sequence prob with picking up the resolutions was solved. Also the picking of single images seems to have been solved by #663 (comment). (btw, sorry for the X:0, Y:0 comment, I actually realized I do not understand this feature, it always shows 0,0, also on non-zarr images -> but the Width in pixels is being displayed okay for zarr) |
|
Thanks @Tom-TBT that's useful info... There's a couple of issues there... I've boosted the target resolution (target pixel size with respect to the size of the panel on the page). So, now the The other issue is that the panel is quite small on the figure. The combination of these fixes improves the impression:
Actually, I also added a further tweak - If the image isn't a big image (we render the whole plane each time, same as from OMERO), we can further boost the targetSize because caching will avoid us having to re-fetch zarr chunks on each re-render. With this change, there's now NO difference in resolution between the panels in your figure. |
|
NB: I noticed the Channel sliders weren't working for that Zarr image because the window min/max aren't set in the zarr json. |
|
Looks good now, thanks Will |
|
The last commit handles any missing values for |
|
Conflicting branch. Resolve conflicts please. |



Previously this was #619, but that PR also included more changes (standalone deployment of OMERO.figure app etc) not related to OME-Zarr support. That PR has been split to make code-review and testing easier.
This PR only adds support for rendering OME-Zarr images in the web app, allowing you to "Add Image" by pasting in a zarr URL instead of an Image ID.
NB: Updates to the export python script to support zarr images are in #662
To test:
Use public OME-Zarr images, e.g. from https://idr.github.io/ome-ngff-samples/ or https://ome.github.io/ome2024-ngff-challenge/ or anywhere else.
We use https://github.com/BioNGFF/ome-zarr.js for some of the rendering logic (rendering arrays to png data url).
The rendering logic for zarr images is the same as for OMERO images. For "small" images, 3k x 3k or less, we render the whole plane each time, and simply zoom and position it relative to the viewport. For bigger images, we render the required region (with some overlap outside the viewport).
We cache the zarr array data that is loaded via zarrita.js, using a key that encodes the range (slices) requested. So when we want to re-render the same region (e.g. adjust rendering settings) we don't have to re-fetch data.
This means that panning "small" images doesn't need to reload the zarr data, but panning bigger images does. Since we cache the whole region (not individual tiles/chunks), even a small amount of panning will re-load the zarr data for the whole rendered region. The amount of data loading is mitigated by rendering at low-ish resolutions.
We save the zarr data to the figure.json for each panel. The
imageIdis used to store the zarr URL:{ "imageId": "imageId": "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0048A/9846152.zarr", "zarr": { "version": "0.5", "zarr_version": 3, "arrays": { "0": { "dtype": "uint16", "shape": [ 3, 91, 13350, 19120 ] }, "1": { "dtype": "uint16", "shape": [ 3, 91, 6675, 9560 ] } }, "multiscales": [ { "axes": [ { "name": "c", "type": "channel" }, { "name": "z", "type": "space" }, { "name": "y", "type": "space" }, { "name": "x", "type": "space" } ], "datasets": [ { "coordinateTransformations": [ { "scale": [ 1, 1, 1, 1], "type": "scale" } ], "path": "0" }, { "coordinateTransformations": [ { "scale": [ 1, 1, 2, 2], "type": "scale" } ], "path": "1" } ] } ] } }The array dimensions allows us to choose the correct dataset array when rendering a particular region.
TODO: