sakoho81 / miplib

A Python software library with a variety of functions for (optical) microscopy image restoration, reconstruction and analysis.
Other
70 stars 24 forks source link

Issues related to deconvolution in ‘deconvolve.py’ files #4

Closed ZhenhongDu closed 4 years ago

ZhenhongDu commented 4 years ago

Yes it's me again, haha. I appreciate your work very much and I have read your procedures carefully,but I still have some doubts due to my own inadequacies. 1、Unable to open file ops_ext.cp36-win_amd64.pyd,so I can't understand how to use the function div_unit_grad() and the update_estimate_poisson() .What is the meaning of their return value?I can only literally understand what they mean,like calculate divergence and Poisson distribution ? 2、I want to use total variation regularization to constrain the RL deconvolution.Can I just assign a value to tv-lambda?What is the appropriate value for tv-lambda, I'll assign it to him. Running the program often results in errors 3、In your article, after using the background mask to remove the background ,the deconvolution works very well.I've added a paragraph “ rl_auto_background=Ture ”to the args_list ,but it doesn't seem to be working properly. I hope you can give me some guidance in your busy schedule. Thank you!

sakoho81 commented 4 years ago

Hi,

  1. The ops_ext is a c extension. You will find the relevant code in the miplib/processing/src/ops_ext.c. The div_unit_grad() calculates the gradient term needed for the TV estimate. Whereas update_estimate_poisson() updates the RL estimate for the next iteration and also estimates the convergence. The return values are exact, stable, unstable and total pixel counts. Basically exact means that a pixel has completely converged, stable within the convergence epsilon, unstable currently not converged. The c-code is actually by Laasmaa et al; you can find more info here http://dx.doi.org/10.1111/j.1365-2818.2011.03486.x espeically on the TV regularization.

  2. Typically a small numerical value like 1e-4 should be a good place to start. A too large value results into weird looking images, whereas a too small value will not do anything useful. You just assign the value as the command line parameter. I don't typically use regularization myself, as I have found that RL typically works better without it, especially if you are using an appropriate PSF (not too small) and background correction.

  3. The background correction should work simply by specifying the --rl-auto-background parameter. Let me know if it doesn't. You can also try to simply set a small numeric value as a command line parameter, e.g. --rl-background=2.

ZhenhongDu commented 4 years ago

I sincerely thank you for your response.