feat: Added flexible backends with the Zarr(s)-Python and Tensorstore support.#393
Merged
feat: Added flexible backends with the Zarr(s)-Python and Tensorstore support.#393
Conversation
… support. Writing OME-Zarr v0.4 is unsupported, we can only write OME-Zarr v0.5 now. BREAKING CHANGE: Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Collaborator
Author
|
While the performance benefits of TensorStore is pretty nice, it's also adding a lot of complexity to handle both of these Zarr implementations. I think for now this is useful in the short term, but a future release we should completely drop it in favor of just Zarr-Python with the Zarrs-Python codec. See:
Very exciting stuff going on over there! |
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
n Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
n Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
n Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
This was
linked to
issues
Apr 2, 2026
Closed
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.
Previously iohub relied on the Zarr-Python internals directly throughout the NGFF layer, and TensorStore was used for a couple of one off features:
Position.to_tensorstore()which opens a FOV as a TensorStore handle manually, and for downsampling.We'd like to be able to "automatically" use TensorStore, or Zarr Python depending on the use case without having to call
.to_tensorstore().We've replaced that with a pluggable backend protocol.
There's a new abstraction layer over in
src/iohub/corewhich defines a ProtocolZarrImplementation[G, A]which is composed of theGroupBackend[G](open/navigate groups), theArrayBackend[G, A](create/open arrays) and anArrayIO[A](read, write, downsample, convert).There are two implementations:
ZarrPythonImplementation(with autodetection of the Rustzarrscodec pipeline) andTensorStoreImplementation(needed some light shims to make it handle the filesystem / Zarr Groups like Zarr-Python, it's a bit messy but I couldn't find a better way).NGFFNDArraywraps any backend handle. All I/O (reads, writes, orthogonal indexing), dask conversion, downsampling, and append delegates to the boundZarrImplementation.ImageArraysubclasses it instead ofzarr.Array.Here's a diagram to show how it's wired up:
This also now defaults to writing OME-Zarr
v0.5and removed the ability to write OME-Zarrv0.4. (Reading OME-Zarrv0.4is still allowed).You can specify the Zarr implementation within
open_ome_zarrlike so: