1111from ._xarray import _downsample_xarray_coarsen
1212from ._itk import _downsample_itk_bin_shrink , _downsample_itk_gaussian , _downsample_itk_label
1313from ._dask_image import _downsample_dask_image
14+ from .._docs import inject_docs
1415
1516class Methods (Enum ):
1617 XARRAY_COARSEN = "xarray_coarsen"
@@ -21,7 +22,7 @@ class Methods(Enum):
2122 DASK_IMAGE_MODE = "dask_image_mode"
2223 DASK_IMAGE_NEAREST = "dask_image_nearest"
2324
24-
25+ @ inject_docs ( m = Methods )
2526def to_multiscale (
2627 image : SpatialImage ,
2728 scale_factors : Sequence [Union [Dict [str , int ], int ]],
@@ -35,7 +36,8 @@ def to_multiscale(
3536 ]
3637 ] = None ,
3738) -> MultiscaleSpatialImage :
38- """Generate a multiscale representation of a spatial image.
39+ """\
40+ Generate a multiscale representation of a spatial image.
3941
4042 Parameters
4143 ----------
@@ -46,10 +48,18 @@ def to_multiscale(
4648 scale_factors : int per scale or dict of spatial dimension int's per scale
4749 Integer scale factors to apply uniformly across all spatial dimension or
4850 along individual spatial dimensions.
49- Examples: [2, 2] or [{'x': 2, 'y': 4 }, {'x': 5, 'y': 10}]
51+ Examples: [2, 2] or [{{ 'x': 2, 'y': 4 }} , {{ 'x': 5, 'y': 10} }]
5052
5153 method : multiscale_spatial_image.Methods, optional
52- Method to reduce the input image.
54+ Method to reduce the input image. Available methods are the following:
55+
56+ - `{m.XARRAY_COARSEN.value!r}` - Use xarray coarsen to downsample the image.
57+ - `{m.ITK_BIN_SHRINK.value!r}` - Use ITK BinShrinkImageFilter to downsample the image.
58+ - `{m.ITK_GAUSSIAN.value!r}` - Use ITK GaussianImageFilter to downsample the image.
59+ - `{m.ITK_LABEL_GAUSSIAN.value!r}` - Use ITK LabelGaussianImageFilter to downsample the image.
60+ - `{m.DASK_IMAGE_GAUSSIAN.value!r}` - Use dask-image gaussian_filter to downsample the image.
61+ - `{m.DASK_IMAGE_MODE.value!r}` - Use dask-image mode_filter to downsample the image.
62+ - `{m.DASK_IMAGE_NEAREST.value!r}` - Use dask-image zoom to downsample the image.
5363
5464 chunks : xarray Dask array chunking specification, optional
5565 Specify the chunking used in each output scale.
0 commit comments