ngff_zarr.to_multiscales¶

Module Contents¶

Functions¶

_ngff_image_scale_factors

_large_image_serialization

to_multiscales

Generate multiple resolution scales for the OME-NGFF standard data model.

API¶

ngff_zarr.to_multiscales._ngff_image_scale_factors(ngff_image, min_length, out_chunks)¶
ngff_zarr.to_multiscales._large_image_serialization(image: ngff_zarr.ngff_image.NgffImage, progress: Optional[Union[ngff_zarr.rich_dask_progress.NgffProgress, ngff_zarr.rich_dask_progress.NgffProgressCallback]])¶
ngff_zarr.to_multiscales.to_multiscales(data: Union[ngff_zarr.ngff_image.NgffImage, numpy.typing.ArrayLike, collections.abc.MutableMapping, str, zarr.core.Array], scale_factors: Union[int, Sequence[Union[Dict[str, int], int]]] = 128, method: Optional[ngff_zarr.methods.Methods] = None, chunks: Optional[Union[int, Tuple[int, ...], Tuple[Tuple[int, ...], ...], Mapping[Any, Union[None, int, Tuple[int, ...]]]]] = None, progress: Optional[Union[ngff_zarr.rich_dask_progress.NgffProgress, ngff_zarr.rich_dask_progress.NgffProgressCallback]] = None, cache: Optional[bool] = None) ngff_zarr.multiscales.Multiscales¶

Generate multiple resolution scales for the OME-NGFF standard data model.

Parameters:
  • data (NgffImage, ArrayLike, ZarrArray, MutableMapping, str) – Multi-dimensional array that provides the image pixel values, or image pixel values + image metadata when an NgffImage.

  • scale_factors (int of minimum length, int per scale or dict of spatial dimension int's per scale) – If a single integer, scale factors in spatial dimensions will be increased by a factor of two until this minimum length is reached. If a list, integer scale factors to apply uniformly across all spatial dimensions or along individual spatial dimensions. Examples: 64 or [2, 4] or [{‘x’: 2, ‘y’: 4 }, {‘x’: 5, ‘y’: 10}]

  • chunks (Dask array chunking specification, optional) – Specify the chunking used in each output scale.

  • cache (bool, optional) – Cache intermediate results to disk to limit memory consumption. If None, the default, determine based on ngff_zarr.config.memory_target.

  • progress (NgffProgress, NgffProgressCallback) – Optional progress logger

Returns:

NgffImage for each resolution and NGFF multiscales metadata

Rtype :

Multiscales