Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New/merging annotations when using the classifier #198

Closed
LiezeB opened this issue Aug 7, 2018 · 5 comments
Closed

New/merging annotations when using the classifier #198

LiezeB opened this issue Aug 7, 2018 · 5 comments

Comments

@LiezeB
Copy link

LiezeB commented Aug 7, 2018

Hi,

I am using the classifier to detect positive and negative cells in a tumor, I am measuring them in three different areas: 500µm outside of the tumor (green), the whole tumor (blue) and tumor centre (black). When I substract the black one from the green one I get an idea of how many cells there are located in the invasive front of the tumor.

I do this by running the classifier on the biggest area (green) and expanding this annotation with -500µm to get the blue one and expanding this one with -500µm to get the black one. It gives me nice results
But because some of my slides only have a part of the tumor (cut), I want the black annotation to be merged with the yellow annotation (to get a correct estimation of the cells located in the invasive front).
When I do this, I get very low cell counts, while I see a lot more cells in that yellow area that should be counted as well. Is there a way to get the correct number of cells when merging two annotations after using the classifier?.

Thanks!
Lieze

qupath classifier

@LiezeB LiezeB changed the title New/merging of annotations when using the classifier New/merging annotations when using the classifier Aug 7, 2018
@petebankhead
Copy link
Member

I suspect the difficulty is with how the hierarchy handles annotations that overlap... that can make knowing that's inside what a bit awkward, and not always very intuitive.

There may be a manual way to do want you want through the user interface, but I suspect it could be quite laborious. Since this looks like it could be generally useful for others as well, my mind always turns to whether it would be cleaner to write a script or add a new command to the software instead...

I have a few questions to check if I understand correctly what you need:

  • What are the final outputs you want? Is it the number of immune cells per mm^2 or something else?
  • Is it problematic that the green region extends outside the tissue?
  • Do you have a strong opinion on having the outer areas (here, green and blue) containing everything (i.e. black nested inside blue, then blue inside green), or would it be acceptable/preferable if each area was independent and non-overlapping (i.e. the black area would be one polygon, but the green and blue would be more like 'hollow rings' around the outside)?
  • Does the Positive cell detection work directly (e.g. if you've got hematoxylin and DAB staining, and you just need a count based on cells where DAB is evident), or do you really need a classifier?
    • If you do need a classifier, do you need to train it new for every image - or do you plan to train it once, and then apply the same classifier for every image?
  • Roughly how many images do you need to analyze in this way? (e.g. tens, hundreds, thousands... to get a rough idea of how automated the approach ultimately needs to be)
  • Have you already got a lot of existing annotations / cells that you need to reuse, or are you just starting? Usually adding new annotations when there are already a lot of cells can be very slow, and it might be easier to create the annotations first before doing the cell detection. But potentially either way could work.

@LiezeB
Copy link
Author

LiezeB commented Aug 7, 2018 via email

@petebankhead
Copy link
Member

I suspect this will be a frequent enough need to deserve its own command in the future... in the meantime I've written a script that I hope will help.

You can find it along with a description here.

I hope it helps, but if you see a way to improve it just let me know.

@LiezeB
Copy link
Author

LiezeB commented Aug 9, 2018 via email

@Tkilvaer
Copy link

I find that defining the inner region from expanding the outer region and intersecting with the original area helps to avoid getting an inner margin in regions where the area of interest expands all the way to the tissue border where it makes no sense to add an inner margin. The central margin is then just the original area - the inner margin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants