Skip to content

Align pyramid downscaling with ome-zarr-py (nearest for labels; tighten tests) #1070

@LucaMarconato

Description

@LucaMarconato

Summary

#1068 adds image-pyramid generation via ome-zarr-py internals as an alternative to multiscale-spatial-image. After ome/ome-zarr-py#516 lands, we can further align and simplify our implementation.

Our pyramid tests currently permit sizable differences from label pyramids produced by multiscale-spatial-image due to mismatched downscaling:

  • multiscale-spatial-image: “nearest” (for labels)
  • spatialdata/ome-zarr-py: “resize” (order 0 to preserve label values)

Note: even after the ome-zarr-py PR merges, per-axis scale factors remain unsupported in ome-zarr-py. This should ideally be upstreamed. Until then, we will keep a custom downscaling function, leveraging the new ome-zarr-py APIs introduced by the PR.

Action items

  • After deprecate scaler class ome/ome-zarr-py#516 is merged:
    • Use “nearest” for labels and align image defaults accordingly.
    • Tighten test tolerances (reduce or eliminate fraction_non_equal for i > 0).
    • Adopt ome-zarr-py’s 3D downscaling APIs to minimize custom logic.
  • Propose upstream support for per-axis scale factors in ome-zarr-py and simplify our code once available. Or choose to maintain this functionality in our code.

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