Changes in threshold result with CP v1.0.4942



I’m testing out the new version of CP with older pipelines and noticed that when I do a simple Otsu’s threshold on an image with dapi stained nuclei the value found in handles.Measurements.Image.Threshold is now a cell variable with three values. It appears the first value is the threshold. What are the other two values?

Thanks, john


Hi John,

The simple answer is that CPthreshold.m (the CPsubfunction that handles the heavy lifting of the threshold calclation) now calculates the threshold in a couple of new ways. Yes, the first of each triplet from handles.Measurements.Image.Threshold ought to be the same as before. Perhaps this is obvious, but you can see the names of the features in handles.Measurements.Image.ThresholdFeatures{:}.

Additionally there are the threshold quality metrics that we call “Sum of Entropies” and “Weighted Variance”. You can see how they are calculated in CPthreshold, but broadly speaking, WeightedVariances calculates the weighted variance of the foreground and background pixels (not surprisingly!), and SumOfEntropies calculates the sum of entropies of foreground and background as separate distributions.

If you want a more detailed explanation, I’ll ask Ray to provide some, since he added these measures recently.