Cell Profiler Pipeline for Brain Section Stainings


I’m trying to perform a simple cell count of stained tissue sections of the brain. I have stained for Fos in the green (FITC) channel and DAPI (cell nuclei) in blue. The pipeline I have constructed is very close to achieving the desired values for the Fos positive cells (which would be a subset of DAPI positive cells). However, not all the Fos positive cells are being counted correctly, while there are some cells that being counted as doublets (as seen in the ‘OverlayOutlines’ module).

The biggest hurdle currently is deciding the ‘Minimum Value’ for either the ‘MeanIntensity’ or ‘IntegratedIntensity’ filters in the ‘FilterObjects’ module. For the ‘MeanIntensity’ parameter, would this value then be the mean intensity of both DAPI AND Fos? Or just the mean intensity of Fos? And similarly for ‘IntegratedIntensity’, would the minimum value be the integrated intensity for DAPI and Fos or just Fos?

Thanks in advance!


Hello @nkamatka

Could you upload your pipeline and a sample image?

Sure thing.
Test.cpproj (876.3 KB)
B1-Fed-DRN-Section4-lateral1-DAPI-wAMP.tif (752.6 KB) B1-Fed-DRN-Section4-lateral1-FITC-wAMP.tif (606.3 KB)

I had a quick look at your pipeline.

Could you explain the logic behind using the FilterObjects module? I couldn’t follow what you were trying to do.

Assuming that you were planning to count all the nuclei and all the Fos positive cells (regardless of their intensity, i.e: even the lower intensity ones to be counted), I just changed your IPOs based on the two images you attached. You may need to make some changes (such as adjusting the lower bound threshold) when you add all of your images.
I added some notes on the note part of some of the modules (top part).
Test_Fos.cppipe (26.7 KB)

Please explain a little what you’re trying to achieve by Filtering, so we can help you better.

Hope this helps!

Hi Nasim,
Thanks a lot for your help. I’ll take a look at your modified pipeline. I’m trying to filter the Fos positive cells that are also DAPI positive (double positive cells only). I was instructed to use the FilterObjects for this function, that is to count all the Fos positive cells that are also DAPI positive.
Thanks again for your help!

If you’re only trying to have the Fos pos DAPI pos cells, I can think of a couple of ways:

  1. The Relateobjects (that you already have in the pipeline), but one caveat is that the Fos is staining cells while DAPI is staining nuclei (based on size and/or pixel shift, they may not correlate 1-1, and I think that might be the reason you see some doubles)
  2. IdentifySecondaryObjects (using Nuclei as a guide), and then relate the Fos pos cells with the Cell objects. It would be perfect if you have a cell marker.
  3. Masking your DAPI with Fos (image or object), and then detect those nuclei, which again may not give you the exact Fos positive cells.

Hi Nasim
So to clarify, Fos staining is also nuclear, but somewhat more distributed through the nucleus. The DAPI stain will be more puncta-like in nature. But yes, both stains are nuclear.


Yes, what I meant was some cytoplasmic signal was observed as well (area wise, more than just nucleus, as c-fos TF could be found in cytoplasm in addition to nucleus). Sorry for the confusion.

Hi Nasim,
Thanks for all the help. Sorry I got busy doing other things. I’ll try to run these different modules today and see what I end up with.

Another quick question I had was whether the different colors of counted nuclei, cells , etc signify anything like intensity of the signal?

Hi Nasim,
After running some more files through the program, I feel like it is somewhat implement CellProfiler from one batch of images to the next. Because my images vary in intensity (the object intensity/background intensity even though they are staining the same things in each set of images), I would have to manipulate the min/max intensities/threshold values for each of the image datasets, which defeats the purpose of the program. How do I account for the variabilities within profiler from one set of images to the next?

Hi @nkamatka,
In the detected objects (below), different colors is just to help to distinguish each object easier.
Screen Shot 2020-04-29 at 9.57.23 AM

However, in the outlines:
in IdentifyPrimaryObjects: Green means detected and Magenta means undetected (and Yellow outlines shows the detected objects that are touching the border of an image, if you have the “Discard objects touching the border of the image” set to Yes)
Screen Shot 2020-04-29 at 9.57.10 AM

in IdentifySecondaryObjects: Green shows the primary object and Magenta shows the identified secondary object
Screen Shot 2020-04-29 at 9.58.40 AM

So, none of the colors are an indication of intensity.

You would usually need to adjust the thresholds between different batches of images. However, you could try to find a broader threshold so that your desired signal falls into that thresholding limits (if possible). You could also try to correct the illumination by CorrectIllumination calculate and apply modules and/or remove the background from your images using ImageMath.
You can find some examples here.