Reader¶
Reads an OME-Zarr 0.5 image. For a plate, open one of its fields.
- class ome_zarr_io.Reader(path)¶
Reads and validates an OME-Zarr 0.5 image (a Zarr group with
multiscales).Open an existing OME-Zarr image for reading.
- Parameters:
path (str | Path) – Path to the image group (the directory containing zarr.json). For a plate, pass one of its fields, e.g.
plate.zarr/A/1/0.- Raises:
FileNotFoundError – If no zarr group exists at
path.
- validate(strict=False)¶
Validate the image (and any attached labels) against the OME-Zarr 0.5 schema.
- get_validation_errors(strict=False)¶
Return a list of validation error messages instead of raising.
- report(strict=False)¶
Return a structured
FilesetReport(validity plus a summary of the image).Unlike
validate(), this never raises for invalid metadata; seeome_zarr_io.validatefor details.- Parameters:
strict (bool)
- Return type:
- get_channel(name, level=0, as_type='dask')¶
Get image data for a single channel, selected by name.
- Parameters:
- Returns:
Array with the channel (‘c’) axis removed.
- Raises:
KeyError – If no channel with that name exists, or the array listed for
levelis missing.ValueError – If the image has no channel (‘c’) axis.
IndexError – If
levelis out of range.
- Return type:
- get_label(name, level=0, as_type='dask')¶
Get a label image by name.
- Parameters:
name (str) – Label name as listed in
label_names.level (int) – Multiscale pyramid level of the label to read (0 = full resolution; negative values count from the coarsest level).
as_type (Literal['dask', 'numpy']) – Return a “dask” (lazy) or “numpy” (in-memory) array.
- Raises:
KeyError – If no label with that name exists, or the array listed for
levelis missing.ValueError – If the label has no valid multiscales metadata.
IndexError – If
levelis out of range.
- Return type:
- get_physical_size(level=0)¶
Get the physical pixel/voxel size for each spatial and time axis.
- Parameters:
level (int) – Multiscale pyramid level to compute sizes for.
- Returns:
Mapping of axis name (e.g. “z”, “y”, “x”, “t”) to a
PhysicalSize, for every non-channel axis.- Raises:
IndexError – If
levelis out of range.- Return type: