Skip to content

How to import Zarr labels (masks)? #188

@will-moore

Description

@will-moore

In #181 we import OME-zarr labels by reading the zarr pixel values and converting them into classic OMERO Masks with the binary data stored in the Postgres database. For large amounts of labels, this has the potential to bloat the DB and doesn't take advantage of having the data as zarr.

We may want to keep it for maximum compatibility with existing tools, but we also want to consider other options:

    1. Use Glencoe's approach:
    1. Use omero-web-zarr to handle urls like https://idr.openmicroscopy.org/webgateway/render_shape_mask/1665606/ and return a png for iviewer.
    • We'd need to add config to omero-web, so we can specify an app to handle this URL, similar the way we specify a viewer to handle image-viewer URLS like $ omero config set omero.web.viewer.view omero_iviewer.views.index
    • Use externalInfo on the Shape to know where the zarr image is. Use the Shape bounding box to crop the zarr image and render to png. NB: we would need some way to specify what the pixel value from the zarr should be used to identify the mask region for rendering to png. This could be an annotation on the Shape?
    • Advantage is that iviewer doesn't have to change, not does any omero metadata populate -> OMERO.tables workflow.
    • Other tools would need to be updated to know how to access the mask bytes (e.g. iviewer or other clients), but that's true of all the options here.
    • Disadvantage is authentication issues. If the data isn't public and auth credentials live on the server, they would have to be made available to omero-web environment too.
    1. Add a new layer in iviewer that loads another OMERO image (used to store the Labels as a separate image) and overlays it on the main image. The OMERO labels-image could use omero-zarr-pixel-buffer to load from the labels image. First attempt at this approach at Support img_detail/9837058/?labelimage=9837059 as extra Tile layer omero-iviewer#511
    1. Update iviewer to read the zarr directly from the browser. Use zarrita.js and maybe ome-zarr.js to render the zarr data for openlayers.
    • Similar pros and cons as the previous approach, but probably a bit harder to hack on iviewer and openlayers etc than to work in python.
    • We wouldn't need to add any config to omero-web or update any other tools.

cc @jburel @dominikl @sbesson @knabar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions