You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are cases when you have already loaded the zarr.json or .zattrs for a multiscale image before you want to create a thumbnail:
In use ome-zarr.js for renderImage() ome/ome2024-ngff-challenge#93 we load the imgAttrs for zarr v3 data to determine whether the URL is to a multiscales image or bioformats2raw or plate. This gives us the full URL to the image itself (e.g. first image in the plate) as well as the image attrs.
In Load 0.6.dev1 schemas from github ome/ome-ngff-validator#48 where we want to show thumbnails for each input image in various coordinateTransformations, we want to check that the image exists by loading the image zarr.json (zarr v3 only for this spec) so that we can show a nice "not found" message instead of a failed thumbnail if the input is not valid.
In such cases, having the attrs in hand allows us to skip the loading of this in renderThumbnail(). This can save us 1 or 2 calls - since renderThumbnail() tries to load both .zattrs and zarr.json as it doesn't know if the URL is for zarr v2 or zarr v3. Having the multiscales attrs can tell us whether we are working with Zarr v2 or v3:
Then the getMultiscaleWithArray() functionality would be split into 2 parts, since the getMultiscale() wouldn't be needed.
The rest of that function, from
onwards can be moved to a new function getArrayInfo().
Then, if we already have the imgAttrs, we call getArrayInfo() to return the same as getMultiscaleWithArray() but if we don't have imgAttrs, we call getMultiscaleWithArray() as now, but it calls getMultiscale() and then getArrayInfo().
@lubianat - if you're interested in working on ome-zarr.js, this could be a good start?
There are cases when you have already loaded the
zarr.jsonor.zattrsfor a multiscale image before you want to create a thumbnail:imgAttrsfor zarr v3 data to determine whether the URL is to a multiscales image or bioformats2raw or plate. This gives us the full URL to the image itself (e.g. first image in the plate) as well as the image attrs.inputimage in various coordinateTransformations, we want to check that the image exists by loading the imagezarr.json(zarr v3 only for this spec) so that we can show a nice "not found" message instead of a failed thumbnail if theinputis not valid.In such cases, having the attrs in hand allows us to skip the loading of this in
renderThumbnail(). This can save us 1 or 2 calls - sincerenderThumbnail()tries to load both.zattrsandzarr.jsonas it doesn't know if the URL is for zarr v2 or zarr v3. Having the multiscalesattrscan tell us whether we are working with Zarr v2 or v3:Zarr v2
Zarr v3 (complete
zarr.json)This would involve adding an
imgAttrsargument atome-zarr.js/src/render.ts
Line 22 in 764db30
Then the
getMultiscaleWithArray()functionality would be split into 2 parts, since thegetMultiscale()wouldn't be needed.The rest of that function, from
ome-zarr.js/src/utils.ts
Line 247 in 764db30
getArrayInfo().Then, if we already have the
imgAttrs, we callgetArrayInfo()to return the same asgetMultiscaleWithArray()but if we don't haveimgAttrs, we callgetMultiscaleWithArray()as now, but it callsgetMultiscale()and thengetArrayInfo().@lubianat - if you're interested in working on ome-zarr.js, this could be a good start?