Cell count based on two stains

Processed Composite.tif (15.6 MB)

Hi ImageJ community!

I KNOW that this question falls in line with many questions titled “double positive count” or some variation of that. However, exploring those options has given me data that isn’t what I am looking for.

In brief:
There are two stains, one for microglia (channel 2) and one for CD68 (channel 1) in tissue (Processed Composite.tif). I am trying to quantify is the number of microglia that are CD68 positive, however CD68 staining is punctuate and there are multiple points of signal inside and outside of the microglia cell body. Using Fiji, I was able to create binary masks of the two channels and did Image Calculator>multiplication function of the two binary masks. However, from this function my resulting image is just the CD58 signal that is inside the microglia (which would give me a count of the number of CD68 puncta are inside the microglia, but not the number of microglia that are have CD68 staining). This result makes sense since the “white pixels” (0 value) are multiplying out the black signal (255) of the microglia binary mask, leaving only the CD68 positive signal within the microglia mask. Example pictures below.

CD68 Binary Mask.tif (3.9 MB) IBA1 Binary Mask.tif (3.9 MB)
Result of IBA1 Binary Mask Multiplication.tif (15.6 MB)

I next tried to make each mask a color LUT (rather than inverted grey LUT) and merged the masks to try and see if color threshold for yellow and green cells only (green=microglia and yellow=CD68 + signal inside the microglia mask) would be the best solution, however I couldn’t figure out how to use this to my advantage.

Now I am currently trying QuPath, using the pixel classifier to threshold my two channels, make annotations of both (based on different threshold parameters) and now I am stuck at classifying these annotations so that I can quantify only the microglia annotations that have the CD68 annotations are counted.

I am curious whether I have truly exhausted working in Fiji (using image calculator) or whether QuPath may be the a better way. I have looked at QuPath’s website and explored their multiplexing and pixel classification tutorials, however was not able to figure out how to work with the different classifications I had created and do “annotation operations” like the union of two annotations or the subtraction of two annotations.

Any input would be greatly appreciated!

I would go with either Subcellular detection within your larger objects, or running the two Thresholders in a row (one on the annotation of the other). To do the first, you need to change the original objects into Cells (object type) so that the Subcellular detection works.

Your better option is more likely to be two thresholders in a row. Create annotation objects with the first (make sure SPLIT is checked), and create Detection objects with the second. Each annotation will then have a measurement that indicates how many detections are within it.

To get more groovy, you could make sure to
then cycle through your annotations and check for the presence of child objects, and classify based on anything being within a given annotation.

children = it.getChildObjects().size()
if (children == 0) {
} else { it.setPathClass(getPathClass("Positive")) }

Wrote all of that quickly without testing, so there may be plenty of typographical errors.

Finally, if you have many of these images, I would add a step where you create a full image annotation, and add a measurement to it indicating how many Positive and Negative child annotations are within it.

If I understand correctly, this may work:

  • Create a classifier/thresholder for microglia
    • Choose ‘Create objects’ to make annotations from the classifier
  • Create a classifier/thresholder for CD68
    • Choose ‘Measure’ to add measurements to all existing annotations

The measurements will tell you the area of CD68 positive pixels found within each annotation. You can then decide how high this needs to be for the cell to be considered positive. This ‘classification’ could be scripted in QuPath, or perhaps done more easily in a spreadsheet after exporting the data.

Something similar could be achieved in Fiji by creating ROIs from one of your binary images, adding them to ROI Manager, and then measuring them in the second image.

If you want counts of CD68 puncta per annotation, then you can use @Research_Associate’s suggestion of creating detection objects from the second classifier in QuPath (rather than ‘Measure’). Or you can convert your CD68 binary image to points in Fiji using ‘Process → Find Maxima…’ and use this instead of the original binary image.

1 Like

Thank you Research_Associate and petebankhead for your input! I will try and follow up if I have any issues/further questions.