diff --git a/dask_image/ndfilters/_threshold.py b/dask_image/ndfilters/_threshold.py index b43fb4af..c9133a80 100644 --- a/dask_image/ndfilters/_threshold.py +++ b/dask_image/ndfilters/_threshold.py @@ -80,7 +80,7 @@ def threshold_local(image, block_size, method='gaussian', offset=0, mode=mode, cval=cval) elif method == 'gaussian': if param is None: - sigma = (da.asarray(block_size) - 1) / 6.0 + sigma = (da.asarray(block_size, like=image._meta) - 1) / 6.0 else: sigma = param thresh_image = _gaussian.gaussian_filter(image, sigma, mode=mode, diff --git a/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py b/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py index 79b67504..4800413a 100644 --- a/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py +++ b/tests/test_dask_image/test_ndfilters/test_cupy_threshold.py @@ -106,7 +106,6 @@ def setup(self): [4, 5, 1, 0, 0]], dtype=int), chunks=(5, 5)) @pytest.mark.parametrize("method, block_size, error_type", [ - ('gaussian', cupy.nan, ValueError), ('median', cupy.nan, TypeError), ]) def test_nan_blocksize(self, method, block_size, error_type):