A package for microscopy image based deconvolution via Optim.jl. This package works with N dimensional Point Spread Functions and images. The package was created with microscopy in mind but since the code base is quite general it should be possible to deconvolve different kernels as well.
We would be happy to deconvolve real data! File an issue if we can help deconvolving an image/stack. We would be also excited to adapt DeconvOptim.jl to your special needs!
|Documentation||Build Status||Code Coverage|
]in the REPL to get to the package manager:
julia> ] add DeconvOptim
A quick example is shown below.
using Revise # for development useful using DeconvOptim, TestImages, Colors, FFTW, Noise, ImageShow # load test image img = Float32.(testimage("resolution_test_512")) # generate simple Point Spread Function of aperture radius 30 psf = Float32.(generate_psf(size(img), 30)) # create a blurred, noisy version of that image img_b = conv_psf(img, psf) img_n = poisson(img_b, 300) # deconvolve 2D with default options @time res, o = deconvolution(img_n, psf) # show final results next to original and blurred version Gray.([img img_n res])
Have a quick look into the examples folder. We demonstrate the effect of different regularizers. There is also a CUDA example. Using regularizers together with a CUDA GPU is faster but unfortunately only a factor of ~5-10. For 3D the speed-up is larger.
For CUDA we only provide a Total variation regularizer via
TV_cuda. The reason is that Tullio.jl is currently not very fast with
The regularizers are generated when
TV() or similar is called. To prevent compilation every time, define the regularizer once and use it multiple times without newly defining it:
reg = TV()
And in the new cell then use:
res, o = deconvolution(img_n, psf, regularizer=reg)
I would like to thank Rainer Heintzmann for the great support and discussions during development. Furthermore without Tullio.jl and @mcabbott this package wouldn't be as fast as it is. His package and ideas are the basis for the implementations of the regularizers.