ngff_zarr.methods

Anti-aliasing methods used to downsample images into a multiscale pyramid.

Submodules

Package Contents

Classes

Methods

Anti-aliasing methods for downsampling an image into a multiscale pyramid.

Data

methods

Backwards-compatible (name, value) pairs for each Methods member.

methods_values

String values of the Methods members, e.g. the CLI --method choices.

API

class ngff_zarr.methods.Methods(*args, **kwds)

Bases: enum.Enum

Anti-aliasing methods for downsampling an image into a multiscale pyramid.

To avoid aliasing artifacts when generating a multiscale representation, the input image is smoothed before it is downsampled. The available methods differ primarily in the smoothing that is applied prior to resampling, and therefore in their amount of artifacts, speed, hardware requirements and portability, and suitability for intensity or label images.

Pass a member to to_multiscales(), for example to_multiscales(image, method=Methods.ITKWASM_GAUSSIAN). See the Methods guide for installation requirements and GPU-accelerated variants of these methods.

Initialization

ITKWASM_GAUSSIAN

‘itkwasm_gaussian’

Smoothed with a discrete Gaussian filter to generate a scale space, ideal for intensity images. The ITK-Wasm implementation is extremely portable and SIMD accelerated. This is the default method.

ITKWASM_BIN_SHRINK

‘itkwasm_bin_shrink’

Uses the local mean for the output value. WebAssembly build. Fast but generates more artifacts than Gaussian-based methods. Appropriate for intensity images.

ITKWASM_LABEL_IMAGE

‘itkwasm_label_image’

A sample is the mode of the linearly weighted local labels in the image. Fast with minimal artifacts. For label images.

ITK_GAUSSIAN

‘itk_gaussian’

Similar to ITKWASM_GAUSSIAN, but built to native binaries. Smoothed with a discrete Gaussian filter to generate a scale space, ideal for intensity images.

ITK_BIN_SHRINK

‘itk_bin_shrink’

Uses the local mean for the output value. Native binary build. Fast but generates more artifacts than Gaussian-based methods. Appropriate for intensity images.

DASK_IMAGE_GAUSSIAN

‘dask_image_gaussian’

Smoothed with a discrete Gaussian filter to generate a scale space, ideal for intensity images. dask-image implementation based on SciPy.

DASK_IMAGE_MODE

‘dask_image_mode’

Local mode for label images. Fewer artifacts than simple nearest neighbor interpolation, but slower.

DASK_IMAGE_NEAREST

‘dask_image_nearest’

Nearest neighbor for label images. Will have many artifacts for high-frequency content and/or multiple scales.

ngff_zarr.methods.methods

None

Backwards-compatible (name, value) pairs for each Methods member.

ngff_zarr.methods.methods_values

None

String values of the Methods members, e.g. the CLI --method choices.