Using the single feature clasifier multiple times

  1. Is there a way by which the single feature classifier can be used multiple times to classify objects in an image?

  2. Can the above be done through a script?

I am trying to calculate H-score for cells which I would like to detect using the “cell + membrane detection” method. However, there is no way to calculate the H-score in that method.

Additionally, “cell + membrane” detection segments regions that do not have a nucleus (correspondingly there is no nucleus hematoxylin or DAB measurement for these objects).

Therefore, to restrict the analysis to objects that only have a nucleus, I would first like to labels objects with a certain minimum nuclear hematoxylin value as “valid cells” and then would like to threshold the valid cells as high, medium or low based on their cell DAB mean value.

Using the single feature classifier, I am able to classify the valid cells. However, when I try to further classify valid cells I am not able to reliably run the method more than twice. More specifically. the method resets the objects to valid cells.

Is there a better way to do this? Any suggestions are greatly appreciated!

Lots of information on classification options in the top paragraph links here.
You absolutely can use the single feature classifier, but it is important that you control your input and outputs exactly through all of your steps. It gets very complicated as you get many classes, and I tend to dislike it for that reason. I will usually go with a scripted classifier from my Gist page, though I am shifting more and more to the GUI classifier linked above. Plus I like being able to run the script on all images rather than clicking through the single feature classifier!

The easiest way would be to classify by cells you want to keep, delete those, and then use the setCellIntensityClassifications() (see wiki or old forum for more info) to set your three levels of DAB. You will then have to calculate the H score yourself, however.It’s a fairly simple calculation though.

Or if you can set the hematoxylin threshold high enough during your Cell Detection step (using the hematoxylin channel), you might be able to use the built in H-score.

Thanks for the reply. I was trying to figure this out based on the example scripts. In my case i have a rather unusual problem, I have two types of cells. One set of cells have entries for nucleus, cell, cytoplasm and membrane measurements whereas the other set of cells have no nuclear measurements. This is because the hematoxylin signal is obscured by the strong DAB signal. I would like to label object with the nucleus measurements as `valid’ (and those without nucleus measurements as ‘invalid’) and then threshold the ‘valid’ cells as high medium and low.

To do the first step, I tried running the following code:

valid = getPathClass(‘Valid cells’);
invalid = getPathClass(‘Invalid cells’);

for (cell in getCellObjects()) {
ch1 = measurement(it, ‘Nucleus: Hematoxylin OD mean’)
if (ch1 > 0.1)

The problem is that the script labels ALL the objects as valid.

My question is this: how can check if an object has the nucleus field as part of its measurement table?


If it would help to remove all objects that lack a nucleus, you could try the following script:

def noNuclei = getCellObjects().findAll {it.getNucleusROI() == null}
removeObjects(noNuclei, true)

That did the trick!