Positive Pixel Count not working on merged annotations

Hello! I’m running an analysis on pre-annotated images and have been merging the annotations into a single one for many different projects. In the project I’m working on right now, there is one image where the positive pixel count function does not seem to run. It runs fine when I import the annotations and keep them unmerged. The detection parameter also works on all of the other images in the project (that have already been merged). Is there a possible reason for that and would you know how I could fix it?

Thank you!

Are you using QuPath v0.1.2? If so, it could be this: https://github.com/qupath/qupath/issues/111
I recall some other discussions about it being strewn across the web (hopefully image.sc will help bring it all together from now on :slight_smile: ) - for example https://github.com/qupath/qupath/issues/67

The command is a bit different with v0.2.0-m2, so if you’re using that it could be a different issue. However either way my energy is mostly going into the pixel classifier in v0.2.0, which I think should be able to replace the positive pixel counter for most if not all applications - and be a lot more useful. But that is still very much experimental & can’t yet be applied through batch processing. All the milestone releases of v0.2.0 should be considered an early look at a work in progress…

I’m using QuPath v0.1.3. I don’t have v0.2.0-m2 as I’ve already started working with projects on v0.1.3 and want to keep that consistent throughout the analyses if that makes sense. I have the hematoxylin threshold at -2 and the DAB threshold at 0.1. Should I put the hematoxylin threshold in the positives?

Is there any error in View-Show log?

Are you tiling before running it? I thought I remembered it having problems with extremely large areas. I think it was mentioned elsewhere before, but if it is your largest merged sample that is a problem…

1 Like

Yes! Please do that - mixing could cause trouble :slight_smile:

:point_up_2: This could be it. I don’t think the positive pixel counter does anything smart with large regions - all you can really do is apply it at a lower resolution (as far as I recall… it is a long time since I wrote/used it).

I’m sorry, but what does tiling mean? Also, I looked View-Show log, but it doesn’t show any error. But in the script log (I’m running a script through the entire process), it says Error running plugin: java.lang.OutOfMemoryError: Java heap space. Not sure what that means.

Thank you!

Ah, so sort of related then. You either need a computer with more memory, or go to the Help -Show setup options and give QuPath access to more memory.

2 Likes

…and/or run it with a higher value for ‘downsample factor’, so that it scales the image down further before processing and this should use less memory (at a cost of getting a lower-resolution result).

2 Likes

It worked! Thank you so much!

That’s true. The only thing I’m worried about is that I’m keeping the parameters the same for all of the images across the projects, so that would interrupt that. It’s alright though, since giving more access to memory worked! Thank you so much! (I think that image.sc is a nicer forum, btw, easier to work with.)

1 Like

Good! And you’re completely correct to want to keep the parameters the same. Glad changing the memory was enough to sort it out.

1 Like