Find and substract a background region in CellProfiler?

Hello!

I am trying to use CellProfiler to do segmentation for a ratiometric assay much like calcium imaging. I’d like to substrate background intensity for each of the two color channels before calculating the ratio. My question is whether CellProfiler has any image math functionality that allows me to find and substract a background region for each of the two color channels before processing results.

Thank you very much for the help!

Jiansong

Yes, though the exact procedure would vary by what you mean by “background region”;

-If you are taking the background intensity across the whole image you could absolutely measure the intensity of the whole image and take a value like the lowest quartile or the median (with the module MeasureImageIntensity) as your background and subtract it (with the ImageMath module) from the image as a whole.

-If you’re talking about using an actual region within the larger image, you can do basically the same thing (except in MeasureImageIntensity you’d click yes to “Measure the intensity only from areas enclosed by objects” and select the name of your background region object); but you’d have to include some way to identify this background region object- if you have a small number if images you can just draw it with “IdentifyObjectsManually” but if you have a large number that’ll get cumbersome quickly.

Good luck!

Thank you! This is really helpful. I think subtract background intensity across the whole image will work. I can get the LowerQuartileIntensity for both Blue and Green Colors with the module MeasureImageIntensity and would like to use that as my background. My problem now is that I couldn’t figure out how to subtract it from the whole image in the ImageMath module. Attached is the pipeline I used. Could you please advise details on how to subtract the LowerQuartileIntensity from the whole image in the ImageMath module? Thanks again!

Background subtraction.cpproj (95.4 KB)

Hi!
In ImageMath you choose Subtract and then where choosing what to subtract from your image you choose Measurement (instead of Image) and select the LowerQuartileIntensity that you measured before.
Best, Christian

Thank you! Could you advise which Measurement Category I should choose? I couldn’t find LowerQuartileIntensity. Thanks again!

You’ve got Measure Object Intensity in there, you need Measure Image Intensity. Once you have that corrected you should see “Intensity” in that dropdown; when you select that it’ll generate a second dropdown where you can select Lower Quartile (or what have you).

It works. Thank you!