Feature request: pyramid_gaussian() ported from scikit-image
- Dominant language
- Python
- Stars
- 226
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
* dask-image version: 0.2.0
* Python version: 3.6.8
* Operating System: macOS 10.15.5 Beta
### Description
Right now I have a standard 2-D image, stored as a dask array. It's very large, since it's loaded from an SVS file, and I'd like to view it in napari. Since it's so large, I'd like to take advantage of napari's pyramid layers, which means I need to convert the array to a pyramidal form. `skimage.transform.pyramid_gaussian` can do this, but it eats up so much of my memory that the script gets SIGKILLed.
### What I Did
```python
with napari.gui_qt():
da_img = # very large 2-D dask array
napari.view_image(list(skimage.transform.pyramid_gaussian(da_img, multichannel=True)), name='image', is_pyramid=True)
```
and the script uses up all my memory and eventually gets SIGKILLed.
This might be because `skimage.transform.pyramid_gaussian` calls `np.asarray`.
https://github.com/scikit-image/scikit-image/blob/ad15736162a216e46834cb4722914bfa01aeb3ae/skimage/transform/pyramids.py#L145-L224
Note that this is a feature request and not a bug report.
Contributor guide
Research direction
Start with the scikit-image pyramids.py implementation linked in the issue and inspect the existing dask-image image-processing entry points for comparable lazy operations. Determine how to provide a dask-backed pyramid without the memory-heavy np.asarray behavior; done means the requested pyramid_gaussian functionality works for large 2-D dask arrays and can supply napari pyramid layers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100