Skip to content

fix: adding ome-zarr v0.4 back#398

Merged
srivarra merged 6 commits into
mainfrom
omezarr/v0.4-back-again
Apr 9, 2026
Merged

fix: adding ome-zarr v0.4 back#398
srivarra merged 6 commits into
mainfrom
omezarr/v0.4-back-again

Conversation

@srivarra
Copy link
Copy Markdown
Collaborator

@srivarra srivarra commented Apr 8, 2026

Allows writing to OME-Zarr v0.4.

Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
@srivarra srivarra linked an issue Apr 8, 2026 that may be closed by this pull request
srivarra and others added 2 commits April 8, 2026 13:10
TensorStore's zarr2 driver requires fill_value to be a boolean
for bool dtype arrays, not an integer 0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…to zarr-python, keeping TensorStore solely for array I/O. Route array access through impl.open_array() in the node layer. Also unblocks OME-Zarr v0.4 store creation and adds a sharding guard for Zarr v2

Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
@srivarra srivarra marked this pull request as ready for review April 9, 2026 17:56
@srivarra srivarra requested a review from ieivanov April 9, 2026 17:57
Comment thread tests/ngff/test_ngff.py Outdated
)
_ = dataset.create_position(row_name=row, col_name=col, pos_name=pos)
ome = dataset.zgroup.attrs["ome"]
ome = dict(dataset.zgroup.attrs) if version == "0.4" else dataset.zgroup.attrs["ome"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the location of ome metadata chance between v0.4 and v0.5? Do we not have a convenience method to extra this metadata, independent on ngff version?

Copy link
Copy Markdown
Collaborator Author

@srivarra srivarra Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it did change.

  • v0.4: flat in .zattrs -> {"multiscales": [...], "omero": {...}}
  • v0.5: wrapped under "ome" key in zarr.json -> {"attributes": {"ome": {"multiscales": [...], "omero": {...}}}}

Copy link
Copy Markdown
Contributor

@ieivanov ieivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in ngff/nodes.py and test_ngff.py look good to me. This PR looks to include other changes in come/implementation too, I haven't reviewed those, @srivarra I'm leaving these up to you.

@ieivanov
Copy link
Copy Markdown
Contributor

ieivanov commented Apr 9, 2026

Thanks Sri. Could you create a pypi release once that's merged?

@srivarra
Copy link
Copy Markdown
Collaborator Author

srivarra commented Apr 9, 2026

@ieivanov

I realized that for TensorStore, we can take Zarr-Python's implementation of Zarr groups and leave the actual Array I/O to TensorStore instead of writing shims for TensorStore.

Could you create a pypi release once that's merged?

yes

srivarra added 3 commits April 9, 2026 12:46
… OME metadata access

Replace inline v0.4/v0.5 metadata branching with get_ome_attrs() from core.compat. Used in NGFFNode.maybe_wrapped_ome_attrs, Plate.first_position, and tests.

Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
…iteral["0.4",-"0.5"]): Replace version: Literal["0.5"] | None = None with version: Literal["0.4",

  "0.5"] on ImagesMeta and LabelImageMeta. Simplify creation code from "0.5" if
  self.version == "0.5" else None to self.version

Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
… and LabelImage _parse_meta

Old v0.4 stores often omit the root version field (SHOULD, not MUST in the spec). Align Position and LabelImage _parse_meta with the Well and Plate pattern of injecting self.version before model_validate.

Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
@srivarra srivarra merged commit d674602 into main Apr 9, 2026
7 checks passed
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.

Bring back writing for ome-zarr v0.4

2 participants