cellmap_flow.utils.zarr_v3
Read support for Zarr v3-format stores (zarr.json metadata).
The zarr package pinned in this project (2.18.4) has no awareness of the
Zarr v3 storage format at all — zarr.open() cannot even recognize a
zarr.json-only store, let alone read one. Bumping to zarr-python 3.x was
considered and rejected (it drops zarr.n5, used elsewhere in this
codebase, and conflicts with the installed funlib.persistence pin).
Instead, this module reads v3 metadata directly with json.load and reads
v3 chunk data via tensorstore’s zarr3 driver, which is already a
project dependency. It mirrors the output contracts of the equivalent v2
helpers in cellmap_flow.utils.ds so callers can dispatch on format and
otherwise not care which one they got. Local filesystem stores only — remote
(s3/gs/http) v3 stores are not handled here.
Attributes
Functions
|
True if |
|
Walk up from |
|
|
|
Merge OME-NGFF 0.5's nested |
|
Open a v3 array for reading. |
|
|
|
Mirror of |
|
Mirror of |
|
Mirror of |
Module Contents
- cellmap_flow.utils.zarr_v3.logger
- cellmap_flow.utils.zarr_v3.ZARR_JSON = 'zarr.json'
- cellmap_flow.utils.zarr_v3.is_v3_container(path: str) bool
True if
pathis a directory with azarr.jsonat its root.
- cellmap_flow.utils.zarr_v3.find_v3_container(path: str) str | None
Walk up from
pathlooking for the nearest directory containing azarr.json. ReturnsNoneif none is found (e.g. a v2 store, or a remote URL).
- cellmap_flow.utils.zarr_v3.read_zarr_json(path: str) dict
- cellmap_flow.utils.zarr_v3.attrs_from_meta(meta: dict) dict
Merge OME-NGFF 0.5’s nested
attributes.omewith the top-levelattributesdict (some writers emit OME metadata unnested).
- cellmap_flow.utils.zarr_v3.open_array_v3(path: str) _TensorstoreArray
Open a v3 array for reading.
pathmust be the array’s own directory (i.e. already descended into, not its parent group).
- cellmap_flow.utils.zarr_v3.multiscales_from_group(group_path: str) dict | None
- cellmap_flow.utils.zarr_v3.get_scale_info_v3(group_path: str) Tuple[dict, dict, dict]
Mirror of
ds.py’sget_scale_infofor a v3 multiscale group.Returns
(offsets, resolutions, shapes)keyed by dataset path.
- cellmap_flow.utils.zarr_v3.find_closest_scale_v3(group_path: str, target_resolution) Tuple[str, list, tuple]
Mirror of
ds.py’sfind_closest_scalefor a v3 multiscale group.target_resolution=Nonedefaults to the finest (first) scale rather than raising, since callers sometimes ask for the “closest scale” without a specific target in mind.
- cellmap_flow.utils.zarr_v3.get_ds_info_v3(path: str)
Mirror of
ds.py’sget_ds_inforeturn contract for a local v3 store:(voxel_size, chunk_shape, shape, roi, axes_names, "zarr").