Skip to content

Look into cases failing in yaozarrs #51

Open

Description

@kevinyamauchi

In imaging-formats/yaozarrs#85, @tlambert03 added a dingus to test yaozarrs conformance. He noted a few cases that might need a closer look (listed below). I will have a look at these before the Zurich hackathon.

# Questionable case: `image-label` without `multiscales` isn't a label image here.
fail  parse_attributes/v0.4/core/valid/label/minimal
fail  parse_attributes/v0.4/core/valid/label/minimal_properties
fail  parse_attributes/v0.5/core/valid/label/minimal
fail  parse_attributes/v0.5/core/valid/label/minimal_properties
fail  parse_attributes/v0.6/core/valid/label/minimal
fail  parse_attributes/v0.6/core/valid/label/minimal_properties

# Questionable case: identical files, and it's unclear what makes them invalid.
fail  parse_attributes/v0.6/core/invalid/image/invalid_multiscale_transform_output
fail  parse_attributes/v0.6/core/invalid/image/invalid_multiscale_transform_input_output

Activity

  1. kevinyamauchi commented on Oct 31, 2026

    @kevinyamauchi
    CollaboratorAuthor

    Related PR addressing:

    • parse_attributes/v0.6/core/invalid/image/invalid_multiscale_transform_output
    • parse_attributes/v0.6/core/invalid/image/invalid_multiscale_transform_input_output

    #50

  2. tlambert03 commented on Nov 1, 2026

    @tlambert03
    Contributor

    I can comment on Questionable case: `image-label` without `multiscales` isn't a label image here.
    It's another case resulting from an inconsistency between the wording of the spec and the JSON schemas.

    the case is parse_attributes/v0.6/core/valid/label/minimal (and the same thing in v0.4 and v0.5, plus the minimal_properties variants):

    {"ome": {"version": "0.6", "image-label": {"colors": [{"label-value": 1, "rgba": [0, 0, 0, 0]}]}}}
    1. oztest says this is valid, and I get why: it passes the official label.schema, which only requires ome, image-label and version, and ome_zarr.schema. It's also the spec repo's own schema-testing fixture (tests/attributes/spec/valid/label/minimal.json).

    2. yaozarrs say's it's invalid:

      v06-attributes.ome.label-image.multiscales
        Field required [type=missing, ...]
      

      because the prose only ever puts image-label on a label image, and a label image MUST be a multiscale image:

      • 0.6: "The zarr.json file for the label image MUST implement the multiscales specification." (L1496), and then "In addition to the multiscales key, the OME-Zarr Metadata in this image-level zarr.json file SHOULD contain another key, image-label" (L1499). (the layout at L94-95 says the same: "both a multiscaled image as well as a labeled image")

      • 0.5: same sentence (0.5.2 L421)

      • 0.4 is the most explicit: "image-label groups MUST also contain multiscales metadata" (0.4.1 L462). (fwiw the 0.4.1 tag doesn't have a label.schema at all, so for v0.4 there isn't even a schema saying this is valid)

        image-label isn't defined anywhere else, so a node with image-label and no multiscales is either a label image missing a MUST, or not anything the wording of the spec defines. yaozarrs follows the prose wherever it's stricter than the schemas, so we call it invalid. That's definitely a call that we could revisit. I vaguely recall prior discussions with OME devs that the spec should be considered to take precedence (but I can't find that now and could be wrong). Which one wins when they disagree is also being discussed right now in Are negative scale values allowed? (schema says > 0, prose says non-zero) ome/ngff#637 (one view, the other), where, if I'm reading it correctly, @clbarnes seems to agree that the text should be normative Are negative scale values allowed? (schema says > 0, prose says non-zero) ome/ngff#637 (comment). See also: Clarify that "image-label" and "multiscales" are siblings ome/ngff#21

    so I think the root cause is really in the spec/schema conflict (or, I'm misreading it).

    for oztest, what if these cases kept testing the image-label block, but in a complete label image, i.e. with a minimal multiscales added? then they'd still be valid, and every implementation should agree on them, whether it follows the schemas or the prose. (rather than moving them to invalid/, which would lose a nice minimal case). This is what @DragaDoncila already did in #1 for the validate_zarr versions of these cases, which yaozarrs passes.

    ... otherwise oztest would need to be asserting an opinion about whether schema or prose dominates.

    (happy to make that PR if you agree with the suggestion)

  3. clbarnes commented on Nov 1, 2026

    @clbarnes
    Collaborator

    I agree that the spec requires labels to be images and would be happy to field a PR to that effect!

  4. vboussot commented on Nov 10, 2026

    @vboussot
    Contributor

    Same here: ngff-zarr does not accept image-label without multiscales, so these six cases fail for us too. If nobody has started, I can send the PR: add a multiscales to the valid minimal label cases, and add an invalid case without it.

    Also, the two cases restored by #50 are refused by ngff-zarr on the schema, so they work as invalid cases again.

  5. tlambert03 commented on Nov 10, 2026

    @tlambert03
    Contributor

    If nobody has started, I can send the PR: add a multiscales to the valid minimal label cases, and add an invalid case without it.

    i haven't started on it. that would be great. i think we're all agreed on the fix

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions