WeisongZhao / sparse-deconv-py

Official Python implementation of the 'Sparse deconvolution'-v0.3.0
Open Data Commons Open Database License v1.0
45 stars 17 forks source link

Preserving total intensity #4

Open george-tog opened 1 year ago

george-tog commented 1 year ago

Hello Dr. Zhao,

I am currently applying sparse deconv to neuron imaging, and I am interested in modifying the loss function to include a term for total intensity conservation, or ideally, local intensity conservation, in hopes of retaining quantitative intensity information. My basic idea is to include a term that is the squared difference of total intensity in the reconstruction and original images. I think using a reasonably large hyperparameter constant would enforce the conservation of intensity while still leveraging sparsity/continuity priors.

However, I am not familiar enough with the optimization method used to understand how to include such a term in the Fourier update equations. Do you think this idea is reasonable, and if so, could you help me with the update equations? (even if it's just showing the mathematical form, I can manage the implementation)

Best, George

WeisongZhao commented 1 year ago

Hi George,

Thank you for your interests. Brilliant idea! Actually, the image fidelity term (Ax-y) will do this "intensity conservation" for you. If you want to apply Sparse deconvolution on neuron imaging, please turn off the background estimation feature. It is maybe relevant to our Extended Data Fig. 10. (when we processed Ca2+ imaging data in Extended Data Fig. 10, we selected no background estimation option to avoid removing the baseline signal.)