Pixel classifier for non-nucleated cells and tissues - how can I improve it?

Hi,
I’m new to QuPath and impressed with what it can do, especially regarding cell detection.
However, what I have are slides with three components: fibrin, red blood cells (RBCs) and thrombocytes (platelets). RBCs and platelets don’t have nuclei and fibrin is an extracellular protein with an amorphous quality in H&E.

I have trained a pixel classifier to identify these three components for quantitative analys since none of them have nuclei. I used rectangular selections of various sizes, one at a time, in which I annotated the components. It does fairly well but not great.

  1. How do improve the classifier?
  2. In “Show annotation measurements”, is it possible to get the total area for each component, or do I have to copy the results to clipboard and paste it in excel?

Kind regards
Oskar

It would help if you posted an image or two with information relating to how the classifier is failing, and whether inter/intra image variability is likely problematic.

If you used the pixel classifier within an annotation, there is usually a sum or percent area within that annotation. Alternatively, if you don’t split during the Object creation portion of using the classifier, you should be able to see the entire object’s area at once.

1 Like

Very interested in this application, the software I’m working on has a number of plugins, QuPath being one, and we’ve gotten a request from a pathologist to help them quantify non-nucleated objects such as RBCs and leukocytes on peripheral blood smears. I’ve gotten the best results using color deconvolution, but am having difficulty separating blood cells as objects. It’s worth noting that our software is visualized both on the PC and inside the eyepiece of the microscope with augmented reality (where most users are performing analysis), so I’m unfortunately unable to use any of the QuPath GUI or drawing tools without writing a wrapper or perhaps with JSON strings.

@Pentala were you able to write a script or something similar for automatic detection, or are you doing detection on a per-ROI basis?

Still going through all of the images sent with the request and determining if it’s something QuPath is best fit for. The attached image is pretty standard to what I’m working with. I don’t think I’ll have an issue detecting the stained neutrophils and lymphocytes as they are strongly stained.

Here’s a result running our segmentation algorithm using color deconvolution (blue is the background media, yellow areas are red blood cells, green is neutrophils).

While this does give a good visualization and precise relative area measurements, handling each cell as an object would be ideal.

Hi
@heyJonBray

 ....but am having difficulty separating blood cells as objects ....

You could test the RGB-> CMYK plugin

I get this:

Editing previous comment now that I’ve looked into this.

This is the ImageJ plugin you are speaking of correct?
That’s great, I can add that java class directly into my project for simplicity sake.

Is your resulting image just the RGB -> CMYK plugin? If not, what detection did you perform there?

Hi
@heyJonBray
I use ImageJ.
I just checked another alternative: use RGB Stack .
It works very well.

run("Duplicate...", "title=1");
run("Duplicate...", "title=2");
run("RGB Stack");
run("Stack to Images");
selectWindow("Green");
setAutoThreshold("Default");
//run("Threshold...");
//setThreshold(0, 144);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Fill Holes");
run("Watershed");
run("Set Measurements...", "area add redirect=None decimal=0");
run("Analyze Particles...", "exclude add");
roiManager("Show All without labels");
roiManager("Set Color", "black");
roiManager("Set Line Width", 3);
selectWindow("1");
roiManager("Show None");
roiManager("Show All");

No other detection required: neither for RGB stack
neither for RGB -> CMYK

@Pentala
Post a picture we can probably help you.

Beautiful, this is exactly where I need to start, thanks so much for the help.

This stain is tough, neither CMYK or RGB stack gives a very solid view of the red blood cells without any trace of the stained cells, but this should be an easy enough workaround - I’ll post updates once I have some scripts that can separate out different types of cells better.

Agree, would love to see the original image from @Pentala knowing this now.

1 Like