ngff_zarr.methods._dask¶
Module Contents¶
Functions¶
Local mean over |
|
Half-up window mean of 64-bit integers in integer arithmetic. |
|
Most frequent value over |
|
|
|
Whether shrinking |
|
The levels of |
API¶
- ngff_zarr.methods._dask._bin_shrink(data: dask.array.Array, axes: dict[int, int]) dask.array.Array¶
Local mean over
axeswindows, remainder trimmed, integers rounded half up.The mean accumulates in float64, which is exact for integers of up to 32 bits; 64-bit integers take the integer path. Rounding half up on integer input gives the same samples as ITK’s BinShrinkImageFilter.
- ngff_zarr.methods._dask._bin_shrink_wide_integers(
- data: dask.array.Array,
- axes: dict[int, int],
Half-up window mean of 64-bit integers in integer arithmetic.
float64 carries 53 bits, so a 64-bit sample converted to it can lose low bits. Each sample is split by the window size into a quotient and a remainder; the quotient sum stays within the dtype and the remainder sum is small, so the mean is exact.
- ngff_zarr.methods._dask._mode(data: dask.array.Array, axes: dict[int, int]) dask.array.Array¶
Most frequent value over
axeswindows, remainder trimmed, the smallest on a tie.
- ngff_zarr.methods._dask._block_mode( ) numpy.ndarray¶
dask.array.coarsen’s reduction for a label map.Sorted, a window holds its equal values in runs and the first longest run is its mode, so the cost follows the window size whatever the number of labels.
- ngff_zarr.methods._dask._reaches_target(ngff_image, previous_image, scale_factor, dim_factors) bool¶
Whether shrinking
previous_imagebydim_factorshits the level size.
- ngff_zarr.methods._dask._downsample_dask_bin_shrink(
- ngff_image: ngff_zarr.ngff_image.NgffImage,
- default_chunks,
- out_chunks,
- scale_factors,
- ngff_zarr.methods._dask._downsample_dask_mode(
- ngff_image: ngff_zarr.ngff_image.NgffImage,
- default_chunks,
- out_chunks,
- scale_factors,
- ngff_zarr.methods._dask._downsample_dask_coarsen(
- ngff_image: ngff_zarr.ngff_image.NgffImage,
- out_chunks,
- scale_factors,
- reduce,
The levels of
ngff_image, each window of each level reduced byreduce.