feat: one OME-ZARR with image + label pyramids by default (+ hatch-vcs) - #8
Merged
Conversation
Stop hand-maintaining the version. hatch-vcs reads it from the latest git tag at build time (v0.3.0 -> 0.3.0) and __version__ reads it back through importlib.metadata, so the tag is the single source of truth and releases need no manual version bump. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Refactor the pyramid-writing into shared helpers and expose two new functions: - add_pyramid(group): add downsampled resolution levels to an existing single-resolution zarr in place, lazily (reuses existing multiscales metadata/axes when present) - write_labels(image_store, labels): store a label image inside an OME-ZARR under the NGFF labels/<name>/ group as its own multi-scale pyramid, with image-label metadata and registration in labels/.zattrs so image + segmentation live in one store Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tile_process now, by default, writes its labels back into the input .zarr store under the NGFF labels/<name>/ group as a multi-scale pyramid (image + segmentation in one file). write_to still overrides to a separate single-resolution store; array inputs use an auto-temp. - labels stream into the store via write_labels/da.to_zarr (OOM-safe) - pyramids downsample X/Y only; Z (and C/T) stay full-resolution, as microscopy stacks are anisotropic - add register_labels helper (pyramid + image-label meta + register) - overlap now defaults to 16 for out-of-the-box boundary context - fix tests for Z-preserving pyramids, overlap default, zarr-v3 API Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Document add_pyramid, write_labels and register_labels on the plugin API page, and rewrite the guide around the new default (tile_process stores image + label pyramids in one OME-ZARR), XY-only downsampling, and plugging in any segmentation function. pdoc picks the functions up automatically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on the OME-ZARR/napari plugins. Five commits:
hatch-vcs— the tag is now the single source of truth, no manual version bumps.__version__reads it viaimportlib.metadata.add_pyramid(add levels to an existing store) andwrite_labels(store a label image inside an OME-ZARR under NGFFlabels/).tile_processdefault — when input is a.zarrand nowrite_to, labels are written back into the input store underlabels/<name>/as a pyramid, so image + segmentation live in one OME-ZARR. Lazy/streamed (OOM-safe).overlapnow defaults to 16. Pyramids downsample X/Y only — Z kept full-res.Notes
write_to=still overrides to a separate single-resolution store; array inputs use an auto-temp.fn.23 passed), ruff clean,mkdocs build --strictclean. Also fixed two pre-existing zarr-v3 test-API calls (Group.zeros).After merge, tagging
v0.3.0publishes automatically (hatch-vcs → 0.3.0).🤖 Generated with Claude Code