Count of classified objects


I’ve been setting up a pipeline to count cells from IHC slides. My final goal would be to run the pipeline on a large number of slides and have for each slide the number of cells stained with DAB out of the total number of cells.

Everything works already quite fine, I was able to identify the total number of cells and then used ClassifyObjects to separate DAB stained cells from the rest. My problem is that I can’t figure out a way to get in the end the raw number of objects per bin on a image basis. In ExportToSpreadsheet I found the possibility to export for every object whether it is in one bin or the other but I found no possibility to access the number of objects per bin as it is displayed in the graph output of ClassifyObjects.

Would be great if you could help me with this! I attached the pipeline I created so far.

IHC.cp (9.07 KB)

Hi Angelika,

I’ve been able to replicate the problem, and it is indeed a bug. It’s now fixed and won’t be a problem in the next release.

In the meantime, a workaround is to use FilterObjects as shown in the attached pipeline. A count of the filtered objects is an output of FilterObjects so it can serve the same function. A few notes:

  • Two FilterObjects modules are needed to get the classified object counts for each bin.

  • The straightforward way to do this would be to use the same measurement to filter that you used in ClassifyObjects. For this, you would need to insert the same cutoff from ClassifyObjects for the cutoff in FilterObjects. However, this means that if you change the measurement and/or cutoff in ClassifyObjects, you will need to change it in FilterObjects as well.
    Instead, I’m using the classification value for each bin as the filtering measurement. Since the classification value is either 0 or 1 (i.e., in the bin or not), you can use a filtering value of 0.5 for FilterObjects, and it will work regardless of whether you change the measurement or cutoff in FilterObjects.

Alternately, you can do away with ClassifyObjects altogether and use FilterObjects alone if you (1) only need the object count for one of the two bins and (2) don’t need the output image that ClassifyObjects provides.

2010_11_24_IHC.cp (10.9 KB)

Hi Mark,

thanks a lot! Your suggested solution works exactly the way I was looking for!