Feature request: pyramid_gaussian() ported from scikit-image
See original GitHub issue- 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
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Build image pyramids — skimage v0.19.2 docs
The pyramid_gaussian function takes an image and yields successive images shrunk by a constant scale factor. Image pyramids are often used, e.g., to...
Read more >pyrtools Documentation
Pyrtools is a python package for multi-scale image processing, adapted from ... Gaussian or Laplacian Pyramid), otherwise the column wrap is ...
Read more >A Gaussian pyramid with scikit-image transform pyramid module
The Gaussian pyramid from an input image can be computed using the scikit-image.transform.pyramid module's pyramid_gaussian() function.
Read more >scikit-image: doc/release/release_0.14.rst | Fossies
We're happy to announce the release of scikit-image v0.14.4! ... will receive bug fixes and backported features deemed important (by community demand) until ......
Read more >SimpleITK Documentation - Read the Docs
of the pyramid to the next and the later receives the sigmas to use for smoothing when ... and superimpose it on top...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s a rough sketch. We could do this by wrapping the same generator pattern around
dask.array.blockwise
Example
And here’s a super tiny example of it in action. We could also use some of the Aperio example data to test it.
Limitations
There are a few key limitations here
multichannel
/channel_axis
support, too(0, 0)
, which is not correct (this happens whenadjust_chunks
tries to downsample an array that already has the smallest chunksize possible:(1,1)
.Questions
We’ll need to test how good the baseline performance is with napari. Perhaps @sumanthratna or @jni could try this out.
Note: even if the performance is sluggish, there might still be a place for this. It’d be useful in situations where you have data, but don’t know which files are the interesting ones you plan to analyze later (so you don’t want to go to all the effort of processing ALL the files into a pyramidal format). Also, we can make sure it’s integrated well with workflows to save out a pyramidal file to disk (then you can do the initial exploration, decide it’s worthwhile saving as a pyramid for better performance, and easily continue with your work)
Just bumping this. This would be quite a useful dask image funcrionality to have when generating multiscale
.ome.zarr
/ngff files from very large arrays.