Counting of double and triple positive cells in multichannel fluorescent image




I have images of tissue sections stained with three fluorescent dyes (DAPI and two cell markers). I need to count double and triple positive cells.

I started by dividing my multichannel image to single channels and was able to create binary mask of DAPI channel with nicely segmented nuclei (used gaussian blur, thresholding, LoG, and watersheding) and binary masks for my other channels (simple thresholding was just fine).

Now I would like to slightly grow my DAPI objects (by 1-2px), but without merging objects, and, by comparing the masks I have, create new masks for DAPI objects that are positive for one or both of my cell markers. Could anybody advice me on how to crate these new masks?

It would be perfect if I could have, in my new masks, only those DAPI objects that have more than few pixels in common with the other masks. As my images are from wide-field microscope I can sometimes see that I have two cells from which one is positive and the other is negative for my marker but they are most likely touching at some depth causing there to be a few bright pixels on my negative cell.

Thanks in advance.


Welcome to the Forum @mmg

It is hard for us to offer help when no image is provided. You already gave the problem a good thought and a bit of effort.
Did you try any of the logical operators (AND, OR) on your binary images?

The binary masks contain 0 or 255 for each pixel and once thresholded can be converted to a ROI and added to the ROI manager. This allows you to measure the number of pixels in a ROI and decide if you want to accept or reject the ROI.

You can also change the mask pixels in each of your masks from 255 to 1,2 and 4 by dividing by 255 and multiplying by 1,2 or 4. These form the binary patterns 001, 010, 100. OR-ing the masks after that will put your pixel values in 8 classes (0…7), each describing which markers are found in that pixel. 0 is no marker, 1 (001) is only marker 1, 2 (010) is marker 2, 3 (011) is marker 1 AND marker 2 etc.
Using the threshold tool for each value 0…7 and measuring area will give you the number of pixels in the cells (probably with the help of ROIs if you want to express per cell).

But then, a posted image will give you more helpful answers.


Hi @eljonco and thank you for your interest in my problem,

Unfortunately as logical operations work on pixels and my signal tends to be unevenly spread through my cells when I try to colocalize DAPI with my first marker I end up with some of my cells divided into few objects and it gets worse when I try to also colocalize it all with the second. That’s why I thought it would be better to create new masks based on DAPI mask by checking whether my DAPI objects colocalise with pixels positive for my markers in my other masks.

Below I provide a sample image

its separation into single channels


and my masks for them


Indeed, more complex than the first posting seemed to indicate.
I get quite reasonable particles when analysing with size 30-infinite and add to roi manager. Once you selected a ROI, you can enlarge the region a number of pixels prior to measuring. I don’t have a quick solution for particles that almost touch in this case. Watershed does come to mind.
After a proper region growing of the selected particle you can then measure its occupied area in the other two mask images.

Would that do?