Skip to content

Make image label key mandatory for label images#89

Open
dstansby wants to merge 3 commits into
ome:mainfrom
dstansby:image-label-must
Open

Make image label key mandatory for label images#89
dstansby wants to merge 3 commits into
ome:mainfrom
dstansby:image-label-must

Conversation

@dstansby
Copy link
Copy Markdown
Contributor

Fixes ome/ngff#339 - see discussion on that thread for motivation.

@github-actions
Copy link
Copy Markdown

Automated Review URLs

@jo-mueller
Copy link
Copy Markdown
Contributor

Potential duplicate/follow-up to ome/ngff#170

@jo-mueller
Copy link
Copy Markdown
Contributor

@dstansby sorry that I haven't reacted here earlier. I'm a bit uncertain about approving this (or not) because I'm not sure about the implications. I.e., I know why this is helpful, but it would also be useful to know why the requirement was weakened from a MUST to a SHOULD in the first place. I.e., if there's a reason that we're not aware of that led to changing this, it would be good to know so we don't repeat potential mistakes of the past 😬

@dstansby
Copy link
Copy Markdown
Contributor Author

As far as I can see the change was made in ome/ngff#165. The only discussion of the image-label key being mandatory or not there was a single comment at ome/ngff#165 (comment), which was not picked up or discussed any further. I'm therefore not really sure what the context/motviation was for making this change in the first place - perhaps @virginiascarlett and @bogovicj have throughts as the authors of ome/ngff#165?

@jo-mueller
Copy link
Copy Markdown
Contributor

jo-mueller commented Mar 31, 2026

Looking at previous version, the statement was usually phrased like this:

Groups containing the image-label dictionary represent an image segmentation in which each unique pixel value represents a separate segmented object.

Which to me reads more like a MUST than a SHOULD but it would be nice if others could weigh in here a bit (discussion for next techdev meeting?)

@dstansby
Copy link
Copy Markdown
Contributor Author

👍 to discuss at a meeting, but since that's not a public meeting I thnk folks should read and add their thoughts to ome/ngff#339 so all the context and discussion is in one place instead of fragmented.

@dstansby
Copy link
Copy Markdown
Contributor Author

Does anyone from the OME side have thoughts on the next steps here? It would be nice to have a decision on whether this is merged in time for 0.6.

@jo-mueller
Copy link
Copy Markdown
Contributor

Where I am concerned, I'll say 👎 Long story short, I think a label image should not be flagged as an invalid image only because it doesn't declare itself to be a label image properly. That will still mean, that it is a valid image (although the default color settings viewers may choose may not make much sense for it).

A longer version of this line of thought is found in this issue. Making this declaration more explicit or introduce a sort of typing of images is something I see more on the plate of RFC8, if anywhere.

@dstansby
Copy link
Copy Markdown
Contributor Author

a label image should not be flagged as an invalid image only because it doesn't declare itself to be a label image properly.

Without the image-label key, the data will still consitute a valid OME-Zarr image group. So I'm not sure why this is a concern?

@jo-mueller
Copy link
Copy Markdown
Contributor

I would read

In addition to the multiscales key, the OME-Zarr Metadata in this image-level zarr.json file MUST contain another key, image-label,

as an equivalent statement to "If it is a label image and doesn't have the image-label field present, it is invalid?

@dstansby
Copy link
Copy Markdown
Contributor Author

If it is a label image and doesn't have the image-label field present, it would be an invalid image label group, but that doesn't prevent it from being a valid image group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to distinguish image and labels-image groups in 0.5

2 participants