How does the automatic smoothing filter selection work?

Hello,

I was hoping to learn the details behind how the “automatically calculate size of smoothing filter for declumping” works. Does it just create a Gaussian filter with standard devation equal to the minimum object size, or something else?

Thanks!

Hi,

The code is here:

calc_smoothing_filter_size is defined ~line 1395. The smoothing filter size is calculated as 2.35*(Minimum size of Diameter of Objects setting)/3.5. Hmm, this seems a little obfuscatory, but it’s a pretty old setting :wink: so we haven’t changed it. OK, we do know that the 2.35 is the relationship between the Full Width at Half Max and the standard deviation (en.wikipedia.org/wiki/Full_widt … lf_maximum). And the 3.5 is perhaps the number of standard deviations? Not really sure - it may have been empirical, but it works ok for us as a first approximation.

Though when this value is applied, in smooth_image near line 1055, the 2.35 is divided off again to return the sigma of the gaussian (so, yes - we smooth with a Gaussian). And this comment is in the code too:

[quote] #
# We not only want to smooth using a Gaussian, but we want to limit
# the spread of the smoothing to 2 SD, partly to make things happen
# locally, partly to make things run faster, partly to try to match
# the Matlab behavior.[/quote]

This is the beauty(?) of open source!
David

Could you provide a link to the source code referenced here? I checked the cellprofiler GitHub, but cannot find any of the variables mentioned.

I know this is an old post but I’m currently working on adding automatic calculation of sigma and other processing values in my application and this topic is relevant to that - would like to check out the aforementioned code!