Counting Cells

Counting Cells Manually vs. Automatically

Cell counting is often performed to determine the results of an assay. This is usually done by taking an image (in this case, the DAPI stained nuclei) and then manually counting them.  As this can be a tedious task (sometimes involving tens or hundreds of images that could have hundreds to thousands of nuclei), I have yet to meet someone who looks forward to this job.

In this Imaging and Confocal tip, I am combining several tips from the past to come up with something applicable to many kinds of experiments. This tip will combine the image segmentation thresholding and benchmarking of your sample to simplify manual counting of cells. We will be doing cell counts of DAPI stained nuclei. The images came from the Broad Bioimage Benchmark Collection, which I covered in the Imaging and Confocal Tip of 9-12-2014. The main segmenting technique we will be using is thresholding (which is categorizing the pixels of interest by their gray value) which I covered in the Imaging and Confocal Tip of 5-19-2004. 

Here is the original image

This was a good set to start with, as it is composed of cultured cells, so the cells are reasonably well spaced and there is good contrast between them. Counting cells in tissue is usually more difficult.

Here are the threshold values:

I have selected all of those pixels with a gray value at or above 30.  The rest of the protocol consists of the following operations.  After the segmentation by gray value, I had the protocol perform a one iteration open operation, which is the combination of a one layer erosion of pixels around the periphery of each object followed by a one pixel dilation of the periphery of each object. This combination has the effect of helping to separate objects. Then I had the protocol perform a separate touching objects function, which is a watershed filter. After determining the separate touching objects, I had the protocol perform an exclude objects by size filter with an upper limit for rejection set at 50 micrometers (these were un-calibrated images, so the software defaults to one micron per pixel).

Here is the segmented image:

When I segmented the image, the software gave me the option of displaying the nuclei in the same color or contrasting colors. I chose contrasting colors so that I could better visualize how well the software separated the nuclei.  As you can see, the software did a reasonable job of separating out the different nuclei, though there are a few where two nuclei are merged and counted as one. The results of the count were as follows:

The count is the number that we are interested in. As you can see, the protocol counted 360 nuclei in this image.

Now the question is, "is the count accurate?"  To determine the accuracy of the protocol, one has to measure how close they came to the "ground truth", the actual number of cells in the image. This image is one of six that I took from the Broad Bioimage Benchmark Collection along with the associated ground truths. The Broad Institute recommends calculation of the ground truth by the mean of two separate manual counts.  Below is a table of the counts, ground truth and the percentage error from the ground truth in the Volocity count.

Here is how the Volocity count and the ground truth compare.

The Volocity count and the manual measurements are highly correlated (R2 = 0.999 (!), slope 1.055, with an error of 0.02), which indicates the Volocity method is as good as the manual count. But the Volocity count is so very much faster that, once you have established the segmentaion parameters, why would you do the analysis any other way?