Reader (ome_zarr.reader)

Reading logic for ome-zarr.

class ome_zarr.reader.Label(node: Node)

An additional aspect to a multiscale image is that it can be a labeled image, in which each discrete pixel value represents a separate object.

static matches(zarr: ZarrLocation) bool

If label-specific metadata is present, then return true.

class ome_zarr.reader.Labels(node: Node)

Relatively small specification for the well-known “labels” group which only contains the name of subgroups which should be loaded as labeled images.

static matches(zarr: ZarrLocation) bool

Does the Zarr Image group also include a /labels sub-group?

class ome_zarr.reader.Multiscales(node: Node)
static matches(zarr: ZarrLocation) bool

is multiscales metadata present?

class ome_zarr.reader.Node(zarr: ZarrLocation, root: Node | Reader | List[ZarrLocation], visibility: bool = True, plate_labels: bool = False)

Container for a representation of the binary data somewhere in the data hierarchy.

add(zarr: ZarrLocation, prepend: bool = False, visibility: bool | None = None, plate_labels: bool = False) Node | None

Create a child node if this location has not yet been seen.

Newly created nodes may be considered higher or lower priority than the current node, and may be set to invisible if necessary.

  • zarr – Location in the node hierarchy to be added

  • prepend – Whether the newly created node should be given higher priority than the current node, defaults to False

  • visibility – Allows setting the node (and therefore layer) as deactivated for initial display or if None the value of the current node will be propagated to the new node, defaults to None


Newly created node if this is the first time it has been encountered; None if the node has already been processed.

property visible: bool

True if this node should be displayed by default.

An invisible node may have been requested by the instrument, by the user, or by the ome_zarr library after determining that this node is lower priority, e.g. to prevent too many nodes from being shown at once.

class ome_zarr.reader.OMERO(node: Node)
class ome_zarr.reader.Plate(node: Node)
get_pyramid_lazy(node: Node) None

Return a pyramid of dask data, where the highest resolution is the stitched full-resolution images.

class ome_zarr.reader.PlateLabels(node: Node)
get_pyramid_lazy(node: Node) None

Return a pyramid of dask data, where the highest resolution is the stitched full-resolution images.

get_tile_path(level: int, row: int, col: int) str


class ome_zarr.reader.Reader(zarr: ZarrLocation)

Parses the given Zarr instance into a collection of Nodes properly ordered depending on context.

Depending on the starting point, metadata may be followed up or down the Zarr hierarchy.

class ome_zarr.reader.Spec(node: Node)

Base class for specifications that can be implemented by groups or arrays within the hierarchy.

Multiple subclasses may apply.

class ome_zarr.reader.Well(node: Node)