ngff_zarr.methods._dask_image¶

Module Contents¶

Functions¶

_compute_next_scale

Helper method to manually compute output image spacing.

_compute_next_translation

Helper method to manually compute output image physical offset. Note that this method does not account for an image direction matrix.

_get_truncate

Discover truncate parameter yielding a viable kernel width for dask_image.ndfilters.gaussian_filter processing. Block overlap cannot be greater than image size, so kernel radius is more limited for small images. A lower stddev truncation ceiling for kernel generation can result in a less precise kernel.

_downsample_dask_image

API¶

ngff_zarr.methods._dask_image._compute_next_scale(previous_image: ngff_zarr.ngff_image.NgffImage, dim_factors)¶

Helper method to manually compute output image spacing.

previous_image: NgffImage The image for which voxel spacings are use to compute spacing for the next scale

dim_factors: Dict Shrink ratio along each enumerated axis

result: Dict Spacing along each enumerated image axis Example {‘x’: 2.0, ‘y’: 1.0}

ngff_zarr.methods._dask_image._compute_next_translation(previous_image, dim_factors)¶

Helper method to manually compute output image physical offset. Note that this method does not account for an image direction matrix.

previous_image: NgffImage The image for which voxel offsets are input

dim_factors: Dict Shrink ratio along each enumerated axis

result: Dict Offset in physical space of first voxel in output image Example {‘x’: 0.5, ‘y’: 1.0}

ngff_zarr.methods._dask_image._get_truncate(previous_image, sigma_values, truncate_start=4.0) float¶

Discover truncate parameter yielding a viable kernel width for dask_image.ndfilters.gaussian_filter processing. Block overlap cannot be greater than image size, so kernel radius is more limited for small images. A lower stddev truncation ceiling for kernel generation can result in a less precise kernel.

previous_image: _NgffImage Chunked image to be smoothed

sigma_values: List Gaussian kernel standard deviations in tzyx order

truncate_start: float First truncation value to try.

result: float Truncation value found to yield largest possible kernel width without extending beyond one chunk such that chunked smoothing would fail.

ngff_zarr.methods._dask_image._downsample_dask_image(ngff_image: ngff_zarr.ngff_image.NgffImage, default_chunks, out_chunks, scale_factors, label=False)¶