ome-zarr-py icon indicating copy to clipboard operation
ome-zarr-py copied to clipboard

Refactor PlateLabels

Open joshmoore opened this issue 4 years ago • 8 comments

https://github.com/ome/ome-zarr-py/pull/62 introduced the PlateLabels class which requires some special casing in order to provide 2 nodes from the same URL. One idea for working around this was to use a #labels suffix or similar to differentiate.

see: https://github.com/BioSchemas/specifications/issues/475 however for potential RDF issues with #suffixes.

joshmoore avatar Dec 02 '20 14:12 joshmoore

@joshmoore I can't see enough detail in #62 to understand your context here, however, if your #suffixes are to define something within the page then they will be fine. The issue in Bioschemas was that the URL of the page was being used for something within the page rather than the page itself.

AlasdairGray avatar Dec 03 '20 13:12 AlasdairGray

Thanks for the context, @AlasdairGray. I'll look into using BMUSE to scrape the suggestion I have here to see if it's a problem or not.

joshmoore avatar Dec 03 '20 13:12 joshmoore

Happy to help review the output if you need it.

AlasdairGray avatar Dec 03 '20 13:12 AlasdairGray

:+1: Ta

joshmoore avatar Dec 03 '20 13:12 joshmoore

After some investigation I am pretty sure this is the source of the ome_zarr download issue reported in https://forum.image.sc/t/hcs-ome-zarr-data-unable-to-download/57114.

$ ome_zarr info https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/2551.zarr/
WARNING:ome_zarr.io:version mismatch: detected:FormatV01, requested:FormatV03
WARNING:ome_zarr.io:version mismatch: detected:FormatV03, requested:FormatV01
WARNING:ome_zarr.io:version mismatch: detected:FormatV01, requested:FormatV03
WARNING:ome_zarr.io:version mismatch: detected:FormatV03, requested:FormatV01
WARNING:ome_zarr.io:version mismatch: detected:FormatV03, requested:FormatV01
WARNING:ome_zarr.io:version mismatch: detected:FormatV01, requested:FormatV03
WARNING:ome_zarr.io:version mismatch: detected:FormatV03, requested:FormatV01
https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/2551.zarr/ [zgroup]
 - metadata
   - Plate
 - data
   - (1, 2, 16, 520, 1032)
https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/plates/2551.zarr/ [zgroup]
 - metadata
   - PlateLabels
 - data
   - (1, 1, 16, 520, 1032)

leads to the top-level path being duplicated in https://github.com/ome/ome-zarr-py/blob/35d56e81a3bbc11cfb355770d29e0c1e5d8c041c/ome_zarr/utils.py#L61-L63 and the sorted operation below in https://github.com/ome/ome-zarr-py/blob/35d56e81a3bbc11cfb355770d29e0c1e5d8c041c/ome_zarr/utils.py#L75 failing as all the elements are duplicated and of equal weight

sbesson avatar Jan 11 '22 15:01 sbesson

Is the refactor of PlateLabels still ongoing? I've been trying to get some Label data into our test cases and it works well to display the label data if I look at a single field of view (dragging zarr_plate.zarr/B/03/0) in napari: Screenshot 2022-06-14 at 16 20 01

But if I drag the whole plate (zarr_plate.zarr) into napari, it only loads the intensity channels and seems to ignore the label channel. Screenshot 2022-06-14 at 16 20 30

(Same if I drag in a specific well, e.g. zarr_plate.zarr/B/03

I saw that some PlateLabels functionality was disabled earlier this year here to make plate loading work: https://github.com/sbesson/ome-zarr-py/pull/1 Is the fact that labels aren't loaded anymore for plates an intended outcome of this?

jluethi avatar Jun 14 '22 14:06 jluethi

Need to generate some new test data to have a look at this again...

will-moore avatar Jun 17 '22 13:06 will-moore

Ah - I found https://gist.github.com/will-moore/0f4cb6b1fdd60a255fcbb956a54a645e to create some data... With a lot of hacks to the code, I got some labels showing...

Screenshot 2022-06-17 at 17 05 50

But even this is not working properly yet (only seeing a single image channel) So I'll try fixing and cleaning this up...

will-moore avatar Jun 17 '22 16:06 will-moore