ngff_zarr.methods._itkwasm¶
Module Contents¶
Functions¶
Raise before building a graph whose blocks the wasm sandbox cannot hold. |
|
Drop the voxels past the last full shrink window on each spatial axis. |
|
Blur and then downsample a given image chunk |
|
Compute the local mean and downsample on a given image chunk |
|
Bin-shrink a block that may include leading non-spatial dimensions. |
|
Data¶
API¶
- ngff_zarr.methods._itkwasm._MAX_VECTOR_COMPONENTS¶
8
- ngff_zarr.methods._itkwasm._WASM_BLOCK_LIMITS¶
None
- ngff_zarr.methods._itkwasm._check_wasm_block_size(
- image: ngff_zarr.ngff_image.NgffImage,
- is_vector: bool,
- smoothing: str,
- kernel_radius=None,
Raise before building a graph whose blocks the wasm sandbox cannot hold.
A block handed to itkwasm spans the spatial chunk, the channel chunk when channels travel as vector components, and the overlap the Gaussian filter reads past the chunk. Chunks smaller than that overlap are merged by map_overlap before the filter runs, so the merged chunks are what count. Integer input to the Gaussian filter is converted to float32 first, which is the size that counts.
- ngff_zarr.methods._itkwasm._trim_to_shrink_multiple(
- image: ngff_zarr.ngff_image.NgffImage,
- dim_factors: dict,
Drop the voxels past the last full shrink window on each spatial axis.
BinShrink produces floor(n / factor) samples along an axis; the remainder never contributes to the output, and a block made only of that remainder shrinks to zero voxels, which aborts the wasm sandbox.
- ngff_zarr.methods._itkwasm._itkwasm_blur_and_downsample(
- image_data,
- shrink_factors,
- kernel_radius,
- smoothing,
- is_vector=False,
Blur and then downsample a given image chunk
- ngff_zarr.methods._itkwasm._itkwasm_chunk_bin_shrink(image_data, shrink_factors, is_vector=False)¶
Compute the local mean and downsample on a given image chunk
- ngff_zarr.methods._itkwasm._itkwasm_chunk_bin_shrink_nd(
- block,
- shrink_factors,
- n_spatial_dims,
- is_vector=False,
Bin-shrink a block that may include leading non-spatial dimensions.
When the block has more dimensions than the number of spatial dims (e.g. it includes time and/or channel axes), iterate over every combination of non-spatial indices, apply bin-shrink to each spatial sub-block, and reassemble the result.
- ngff_zarr.methods._itkwasm._downsample_itkwasm(
- ngff_image: ngff_zarr.ngff_image.NgffImage,
- default_chunks,
- out_chunks,
- scale_factors,
- smoothing,