Skip to content

Feature request: Option for multiscale images opened with aszarr to be valid OME-Zarr #335

Open

Description

@psobolewskiPhD

Right now using aszarr returns zarr that are almost valid OME-Zarr, but not quite.

For example, for a multiscale (pyramidal) image, the multiscales metadata follows ome-zarr. But, the arrays after level 0 have axes names like Y1, X1 (where 1 is the level) that don't follow:

The “dimension_names” attribute MUST be included in the zarr.json of the Zarr array of a multiscale level and MUST match the names in the “axes” metadata.

see: https://ngff.openmicroscopy.org/specifications/0.5/index.html#axes-metadata
(I think the current behavior is for xarray usage, which is totally understandable.)

Also, for the case of an RGB image, the axis order is returned as YXC, which is unfortunately invalid, as C needs to be before spatial axes:

The order of the entries MUST correspond to the order of dimensions of the zarr arrays. In addition, the entries MUST be ordered by “type” where the “time” axis must come first (if present), followed by the “channel” or custom axis (if present) and the axes of type “space”.

See: https://ngff.openmicroscopy.org/specifications/0.5/index.html#multiscales-metadata
The transpose codec does work to resolve this, i've tested it in a wrapper.

All of this can be worked around using a wrapper, but would be really nice if there was a built in option to get valid OME-zarr out-of-the-box.

(an omero block with channel metadata would be nice too, but that's just window dressing)

Activity

  1. cgohlke commented on Oct 6, 2026

    @cgohlke
    Owner

    I think the current behavior is for xarray usage

    yes. I'll have to review xarray and OME-Zarr to see if this can be resolved.

    as C needs to be before spatial axes

    The OME-XML model has a SamplesPerPixel property but I don't see that in OME-Zarr. Am I missing something? That means interleaved RGB images (the most common image type in the world by far) cannot be represented in OME-Zarr? Bummer. Anyway, series in TIFF files may have many dimension types and orders that are not supported by the 5D OME models. You'll have to use transpose or other workarounds (or just fail) for those files.

  2. psobolewskiPhD commented on Oct 6, 2026

    @psobolewskiPhD
    Author

    I agree the axes restrictions are pretty frustrating. There is an RFC to improve this, but I'm not sure on the status.
    I totally understand if you want to close this as no-thanks. Might help the next person who gets a bit confused like me!

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions