Data (ome_zarr.data)

Functions for generating synthetic data.

ome_zarr.data.astronaut() tuple[list, list][source]

Sample data from skimage.

Returns:

  • pyramids – List of pyramid arrays.

  • labels – List of labels.

ome_zarr.data.coins() tuple[list, list][source]

Sample data from skimage.

Returns:

  • pyramids – List of pyramid arrays.

  • labels – List of labels.

ome_zarr.data.create_zarr(zarr_directory: str, method: ~collections.abc.Callable[[...], tuple[list, list]] = <function coins>, label_name: str = 'coins', fmt: ~ome_zarr.format.Format = FormatV05, chunks: tuple | list | None = None) Group[source]

Generate a synthetic image pyramid with labels.

ome_zarr.data.make_circle(h: int, w: int, value: int, target: ndarray) None[source]

Apply a 2D circular mask to the given array.

>>> import numpy as np
>>> example = np.zeros((8, 8))
>>> make_circle(8, 8, 1, example)
>>> print(example)
[[0. 0. 0. 0. 0. 0. 0. 0.]
 [0. 0. 1. 1. 1. 1. 1. 0.]
 [0. 1. 1. 1. 1. 1. 1. 1.]
 [0. 1. 1. 1. 1. 1. 1. 1.]
 [0. 1. 1. 1. 1. 1. 1. 1.]
 [0. 1. 1. 1. 1. 1. 1. 1.]
 [0. 1. 1. 1. 1. 1. 1. 1.]
 [0. 0. 1. 1. 1. 1. 1. 0.]]
ome_zarr.data.rgb_to_5d(pixels: ndarray) list[source]

Convert an RGB image into 5D image (t, c, z, y, x).