vitessce/vitessce-python

Figure out why omero metadata might be within multiscales[0] rather than at root level of .zattrs

Opened this issue · 2 comments

Vitessce is expecting the "omero" property to be in the root of the .zattrs dict, but it is within multiscales for some reason
(Perhaps this was always a valid location for it, or perhaps it changed in a newer version of the OME-Zarr specification).
Reference: https://github.com/vitessce/vitessce/blob/cf48564ff115f1260b20a5dfd1958aaa7048ac3e/packages/file-types/zarr/src/ome-loaders/OmeZarrLoader.js#L34C13-L34C18

For now, we can manually copy the value to the root of the dict so that it is where Vitessce expects.

with open(zattrs_path, "r") as f:
    zattrs = json.load(f)

zattrs["omero"] = zattrs["multiscales"][0]["omero"]
with open(zattrs_path, "w") as f:
    json.dump(zattrs, f)

Update: seems like a bug ome/ome-zarr-py#260

Related: we do specify the ome-zarr version in https://github.com/vitessce/vitessce-python/blob/main/pyproject.toml#L36

But perhaps it is not respected when installing other packages at the same time like:

pip install vitessce[all] jupyterlab

(similar to #254 issue)