Manual Threshold


I’m trying to set a manual threshold based off a cutoff calculated using the pixel intensity frequency of a nucleus. For example if I wanted to make my cutoff based off a histogram generated in python at a value of 100 (x axis), how could I apply that to all the images? I know there is a manual threshold setting but the the range for this setting is between 0 and 1. Is there some type of conversion factor?


Hi Francisco,

You are in luck, because most of the built-in thresholding methods in CellProfiler do some version of what you describe, but even more automatically! They utilize the intensity histogram just as you attached, and calculate a threshold from it in some way. Please read the section here ( … jects.html) labeled “Select the thresholding method”. For example, the “Background” method finds the mode of the histogram (its peak) and doubles that value and sets that as the threshold. The benefit of using this “automatic” threshold is that if the lighting conditions change globally, the whole histogram might be shifted left or right, but the mode will then shift with it and thus the calculated foreground/background will be compensated for. Any “hard” threshold, like 100 in your plot, is thus prone to be not very robust.

As for the 0-to-1 scaling within CellProfiler, please read why we do this here:

Hope this helps!