-
Notifications
You must be signed in to change notification settings - Fork 281
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
Simple tissue detection for TMA does not work #53
Comments
I have the same problem with CZI files. Pete answered with this - i didnt try to find if my settings were FL instead of brightfield yet, but most of the suggestions i tested already. It did not help. Here the suggestions: This happens whenever QuPath is unable to detect any cores. There are a few reasons why this may occur:
If the image type is set correctly, then I would try increasing and decreasing the TMA core diameter to see if this gives any improvements. If not, then there may be some issue happening internally when trying to read from the CZI file - although I have not seen such a problem before. The contents of View → Show log may be helpful to track down the problem. |
It could be due to a yellow background as I think the background is taken into account when determining the threshold. On most slides where the background is very white, the "Background" at the bottom of the Image tab on the left should be close to 255,255,255. If you background is not white, this should be different (but still close to 255,255,255), and you can fix that by running Analyze->Preprocessing->Estimate Stain vectors. Make sure you have a large chunk of whitespace (well, background I suppose, in this case!) in the annotation you have selected for the estimation, then when you get the first popup that asks you if you want to accept the Mode value, say "yes." You don't need to continue with the actual stain estimation if you have already run it, just "Okay" out. |
I found the source for the problem with my czi TMAs. Like Pete said, it helped to change the autorecognition of the image type from fluorescence to brightfield. |
Adding to the above suggestions, I understand by the manual you mean the section on TMA CD3 analysis. You can see in the screenshots the kind of settings that were used in that example - in particular, note that the default 'Requested pixel size' is large (20) in the first screenshot showing tissue detection, and the boundary is very coarse and inaccurate for the TMA core. In the second screenshot, this value is low (4), and the boundary is much better. The description is:
These values depend upon the pixel size information being stored in the image; if you are working with an image where that information is missing (e.g. a JPEG, a PNG) or incorrect then that would cause trouble. Apart from that, if you could provide any screenshots showing your results then this would help identify what is wrong. If the background is particularly dark and yellow then it could be the problem, because Simple tissue detection works by converting your image to grayscale first, and then applies a threshold to find darker or lighter pixels (this is why it's 'simple'... it doesn't use color information in any smarter way than that). If the background is dark enough, maybe this grayscale image doesn't have good enough contrast for the detection to work. But usually this isn't the case. If that does turn out that something more sophisticated is needed, then there would be other ways to detect the tissue that can be adapted to your particular images (e.g. with an ImageJ macro). But since these would require considerably more effort, it would be worth it to try to find Simple tissue detection settings that work well enough first. Finally, depending upon what you want to do you might not need to detect the tissue at all - I often don't. For example, you could simply detect cells within the TMA core directly. This can give you some measurements (e.g. percentages of positive cells, H-scores), but not others (e.g. tissue area, positive cell density). |
Ooh, that is good to know! I hadn't realized the tissue detection did not use the colors at all. That nixes the entire first paragraph of my first comment! And to add on to Peter's last comment, I frequently calculate tissue area in R after the fact, using a sum of the cell areas in each core, or create a second set of cells temporarily with a larger cell expansion if the density is low (large enough that the fake cells fill in most of the tissue space) to get a fairly accurate measure of the tissue area in order to generate a positive cells/mm^2 value. And if the significant yellowing is the primary culprit, a difference just +/- 1 on the threshold could make a huge difference as long as the background is consistent. |
Thank you very much, Svidro, DHaumannHSA and petebankhead for your quick and helpful answers! Very much appreciated! I did not know tissue detection did not use colors! Very interesting! |
Slightly off QuPath- I don't know what scanner you are using, but if you have access to it, I think most should have a brightfield compensation image adjustment setting (it takes a picture of a blank slide and adjusts). We had some yellowing in ours after some software updates, and that took care of the background. |
Thank you Svidro for your advice. I will look into it! |
I would recommend trying the script here: |
Thanks! this indeed solve the issue. I guess it would be nice to have an option to force QuPath to draw the grid even if the cores are not detected in a similar manner to what the script does. |
When trying to run the simple tissue detection for TMA, as suggested in the manual, it won´t work (the detection lines being either very coarse or not even touching the tissue of the TMA core) no matter how I change the settings. Could this be due to the yellowish background (whitespace) of my slide? How can I change this?
The text was updated successfully, but these errors were encountered: