Counting and co-localizing cell bodies with 3 fluorophores in Z-Stack


I am trying to count 3 different types of neurons in z-stacks projection. I was able to develop a pipeline but I still do not have a final file with information I can understand (Ex: #of neurons per color, #ofneurons that co-localize 2 color or maybe 3, etc etc). My goal is simple I only need to have the total number of objects in each color image and how many overlap between: greenxred, redxblue, bluexgreen and, if possible greenxredxblue. Could someone please take a look in my pipeline and provide me some guidance? In addition, although I was able to extract one spreadsheet I can not really understand what is there.

Not sure how to share my pipeline and images here. So here is the link to a message I sent before:

Thank you so much!



I think you got off to the right start (at least in theory, I haven’t played with your pipeline super thoroughly) but after you do your three rounds of IdentifyPrimaryObjects instead of what you have I’d use 4 MaskObjects modules instead- you can mask green by red, red by blue, green by blue, then one of your two channel overlaps (say green by red) by the last channel (blue). My guess is that in Handling of objects that are partially masked you’ll want to pick the Remove based on overlap option, so that you can call overlapping objects positive or negative based on how much they overlap (something that overlaps only 2% is probably junk, something that’s 90% is likely really multi-positive), but you should play with all those settings across a few images to see what gives you the results closest to what you expect.

If you do this, at the end of your pipeline you can just look at the Image spreadsheet and for each image you’ll get Count_Green, Count_Red, Count_Blue, Count_GreenAndBlue, etc etc etc.


That really gives me a direction. It totally make sense to compare the masks to count the number of overlap.I will improve that part of my pipeline. : )

If you do not mind, I have more questions. I have images with neurons that express less or more protein. When I use the automatic threshold strategy in the IdentifyPrimaryObject mode it recognizes the strong objects but it does not pick the weak one (you can check my green channel for that I uploaded 2 imagens with more or less background) (BTW, these are z-stacks projections and treated images in ImageJ before starting the Cell Profile pipeline) . I already tried to transform the image to binary but than the IdentifyPrimaryObject is not working well. I am pretty sure this is a adjustment issue, so any advice that could put me in the correct pathway would be a lot of help.

Colocalization test3 for color images.cpproj (749.8 KB)


In that case, I’d suggest trying a different thresholding method; Otsu 3-class (with the middle class set to foreground) can work well with images where you have background-dim staining-bright staining and want to capture both, or RobustBackground can be nice if your images are mostly background; you can also try switching from global to adaptive thresholding so that CP breaks your images into smaller portions and calculates the threshold separately for each, which may help when you have dim neurons in one place and bright ones in another.


I have almost similar issue as Karina. I want to calculate the count of total cell number (from DAPI image) and count of cytoplasms that are positive for CK or Vimentin or double positive. However, I’d like to do this by comparing different channels with tertiary objects because segmentation would be more simple and easier that way. Of course I should first set thresholds for each channels (from negative control) to but I haven’t been able to figure out how this and actual counting could be done. Do you think this is even possible, and if so can you give any hints which modules I could try?

My pipeline and images are here:
3colors.cppipe (14.3 KB) (5.7 MB) (4.8 MB) (4.6 MB)

Thanks in advance,


Hello Nina,
Please take a look at the discussion here which may help: Measuring transfection efficiency and cell counting with Cell Profiler
The available tools for counting subpopulations of cells after you determine object intensities are “ClassifyObjects” > “FilterObjects” > “CalculateMath” from which you should be able to obtain results such as counting the double positives. Although it looks like your total cell number count looks ok, another thing you can try out (which is also discussed in the above link) is to use “CorrectIlluminationCalculate” followed by “CorrectIlluminationApply” at the beginning of your pipeline which can equalize the illumination of each objects so that you have a more accurate total cell number count that may otherwise be affected by a large difference in intensities on the DAPI image.