Data (ome_zarr.data
)
Functions for generating synthetic data.
- ome_zarr.data.create_zarr(zarr_directory: str, method: ~typing.Callable[[...], ~typing.Tuple[~typing.List, ~typing.List]] = <function coins>, label_name: str = 'coins', fmt: ~ome_zarr.format.Format = FormatV04, chunks: ~typing.Tuple | ~typing.List | None = None) Group
Generate a synthetic image pyramid with labels.
- ome_zarr.data.make_circle(h: int, w: int, value: int, target: ndarray) None
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.]]