Describe the issue:
dask_image.ndfilters.threshold does not preserve the data type. If the input image is dtype np.single then the output is np.double
Minimal Complete Verifiable Example:
import numpy as np
import dask.array as da
from dask_image.ndfilters import threshold_local
data = da.random.normal(size=(100, 200, 200)).astype(np.single)
print(f'{data.dtype=}')
print(f'{threshold_local(data, [5, 10, 10]).dtype=}')
Anything else we need to know?:
Environment:
- Dask version: '2025.10.0'
- Python version: Python 3.12.3 (main, Mar 3 2026, 12:15:18) [GCC 13.3.0]
- Operating System: Ubuntu 24.04.4 LTS
- Install method (conda, pip, source): pip
Describe the issue:
dask_image.ndfilters.threshold does not preserve the data type. If the input image is dtype np.single then the output is np.double
Minimal Complete Verifiable Example:
Anything else we need to know?:
Environment: