ngff_zarr.from_ngff_zarr

Module Contents

Functions

_is_remote_store

Whether store refers to remote storage needing an fsspec backend.

_remote_backend_import_error

Build an actionable ImportError pointing at the [remote] extra.

_apply_blosc_codec_compat

Monkey-patch BloscCodec.from_dict to strip deprecated nthreads/blocksize keys.

from_ome_zarr

Read an OME-Zarr NGFF multiscales data structure (NgffMultiscales) from a Zarr store.

Data

API

ngff_zarr.from_ngff_zarr.zarr_version

‘parse(…)’

ngff_zarr.from_ngff_zarr.zarr_version_major

None

ngff_zarr.from_ngff_zarr.REMOTE_URL_SCHEMES

(‘s3://’, ‘gs://’, ‘azure://’, ‘http://’, ‘https://’)

ngff_zarr.from_ngff_zarr.REMOTE_FS_PROTOCOLS

‘frozenset(…)’

ngff_zarr.from_ngff_zarr._is_remote_store(store) bool

Whether store refers to remote storage needing an fsspec backend.

Handles plain URL strings/paths as well as zarr-python 3 FsspecStore instances (built here when storage_options is provided, or passed in directly), whose str() does not start with the URL scheme.

ngff_zarr.from_ngff_zarr._remote_backend_import_error(store, original: ImportError) ImportError

Build an actionable ImportError pointing at the [remote] extra.

ngff_zarr.from_ngff_zarr._DEPRECATED_BLOSC_KEYS: frozenset

‘frozenset(…)’

ngff_zarr.from_ngff_zarr._apply_blosc_codec_compat() None

Monkey-patch BloscCodec.from_dict to strip deprecated nthreads/blocksize keys.

Older zarr v3 implementations wrote nthreads and blocksize into the Blosc codec metadata. These keys are no longer recognised and cause BloscCodec.from_dict to raise. This patch filters them out (both at the top level of the codec dict and inside a nested "configuration" mapping) before passing control to the original method.

ngff_zarr.from_ngff_zarr.from_ome_zarr(
store: ngff_zarr._zarr_types.StoreLike,
validate: bool = False,
version: str | None = None,
storage_options: dict | None = None,
) ngff_zarr.multiscales.NgffMultiscales

Read an OME-Zarr NGFF multiscales data structure (NgffMultiscales) from a Zarr store.

store : StoreLike Store or path to directory in file system. Can be a string URL (e.g., ‘s3://bucket/path’) for remote storage. For .ozx files, provide the path to the .ozx file.

For HCS (High Content Screening) plates, provide the path to a
specific well and field within the plate (e.g., 'plate.zarr/A/1/0'
for well A1, field 0). To load the entire plate structure, use
from_hcs_zarr() instead.

For bioformats2raw containers with a single image, the function
will automatically navigate into the image subgroup. For containers
with multiple images, provide the path to a specific image
(e.g., 'container.ome.zarr/0').

validate : bool If True, validate the NGFF metadata against the schema.

version : string, optional OME-Zarr version, if known. For .ozx files, the version will be read from the ZIP comment if not provided.

storage_options : dict, optional Storage options to pass to the store if store is a string URL. For S3 URLs, this can include authentication credentials and other options for the underlying filesystem.

Returns

multiscales: multiscale ngff image with dask-chunked arrays for data

ngff_zarr.from_ngff_zarr.from_ngff_zarr

None