dask-image
dask-image copied to clipboard
Deconvolve Implementation
A few weeks ago @jakirkham, myself, and other NVIDIA folks with @tlambert03, @sofroniewn, and other napari/czi folks we chatted about having better support for deconvolve (with Richardson Lucy) within the dask ecosystem. During that discussion we demonstrated a nascent effort to perform RL in fft space with a modified version from AIAPY's deconvolve . Current version of the demo lives here:https://gist.github.com/quasiben/fd6bc00ae72ef5ae15e7c1e49f92b1ae#file-rl-w-fft-w-dask-ipynb Some things which @tlambert03 brought which would make a significant impact for image scientists would include options/features to handle the following:
- PSF rotational averaging within the implementation
- Interpolation of the PSF to handle different step sizes between PSF and chunks
We have briefly explored modifications to scikit-image but we have two issues:
- NEP-18/35 work which needs to be handled
- New FFT implementation of Richardson-lucy
What I would like the dask-image to consider is a deconvolution function which supports both host and device implementations.
Thanks for writing this up, Ben. 🙂
Yeah having some kind of function in dask-image that applies a deconvolution over a larger image makes sense.
Would think any lower level GPU code would live outside Dask-image, but ideally be callable from Dask-image. Possibly though some TBD dispatch mechanism ( https://github.com/dask/dask-image/issues/133#issuecomment-625118969 ).
cc @jni @GenevieveBuckley (in case you have other thoughts here 🙂)
This would be very useful to have, definitely. Thank you for the excellent summary @quasiben
Semi-related, my colleague @VolkerH did some experimenting with using dask to deconvolve large arrays in tiles. I'm linking to it here, so I don't forget the location: https://github.com/hammerlab/flowdec/blob/master/python/examples/notebooks/Tile-by-tile%20deconvolution%20using%20dask.ipynb
You might also be interested in this comment and the few following it in scikit-image/scikit-image#4083
It demonstrates that scikit-image's deconvolution can be accelerated by either 1.) enabling multi-threading for the FFTs (requires SciPy >=1.4) 2.) using Dask to deconvolve blocks in parallel. This tiled operation can be done already via scikit-image's apply_parallel which is a utility that relies on Dask.
Useful links:
- Dask blogpost by John and Ben: https://github.com/dask/dask-blog/pull/77
- Exploring the performance of Richardson-Lucy deconvolution in scikit-image: https://github.com/scikit-image/scikit-image/issues/4083
https://forum.image.sc/t/pycudadecon-updated-with-easier-install-and-napari-plugin/53390