scverse / spatialdata

An open and interoperable data framework for spatial omics data
https://spatialdata.scverse.org/
BSD 3-Clause "New" or "Revised" License
199 stars 35 forks source link

ome-zarr labels source metadata #244

Open joshua-gould opened 1 year ago

joshua-gould commented 1 year ago

According to the ome-zarr spec (https://ngff.openmicroscopy.org/latest/#labels-md), "The value of the source key MUST be a JSON object containing information about the original image from which the label image derives." Is there a way to include this using spatialdata? Thanks.

LucaMarconato commented 1 year ago

With our APIs we can (some things are almost finished but will be ready soon) overlay labels to images with different resolutions/coordinate transformations. These use cases open up the possibility of some "orphan" labels that are not associated to any image (for instance they could have derived from an image with higher resolution and/or living in another Zarr store).

This is the reason why we didn't fill that piece of metadata during the labels io code that we wrote a few months ago. Anyway, since we want to be fully NGFF compliant, we need to fill this information when known. Thanks for reporting. FYI @giovp

cc @timtreis when this will be implemented I would still not use this information to show labels on top of images, but have the users specify them or have them inferred from the coordinate systems. This to avoid populate the code logic with edge cases describing data relationships. Wdyt?