Big tumor areas to analyse: any tips of how to not let the project so heavy and slow down the computer?

Hi all!

I’m using the QuPath to evaluate tumor and stroma percentage, but it was requested to do it in all tumor area. Otherwise, some samples have really big tumor areas, letting the computer slow and sometimes, giving an error or a bug.

Someone have some tips to share?

Thanks a lot!
Nice evening everyone!

How much RAM do you have and how much did you allow QuPath to use when you started it?

Some projects will likely be too big for certain computers if you want to analyze millions of cells. In some cases, if you are capping out on RAM, you might be able to reduce the number of processors used in the Preferences, or increase the amount of RAM available in the Help menu. I would start there, with the most likely to work option being turning the processors down to 1. It might take a very long time, though. That is the tradeoff.

Hard to help too much without more information, like the exact error, what your computer specs are, how many cells/what area is “big.”

If your computer is not strong enough and your cannot turn down the settings any further, you may want to look into subdividing your analysis. You could tile your tumor area, and then run the cell detection one smaller tile at a time. The smaller your tiles, though, the more cells you will split in half by having an annotation border run through them.

1 Like

@biancatroncarelli Can you give some more details, e.g. the steps you’re using (cell detection, pixel classification; interactively or via a script) and exact error messages you see? Information under View → Show log can be helpful.

As @Research_Associate says, reducing the number of parallel threads can help with some problems (note that 48 is not a normal number to have there, unless your computer has a ridiculously large number of processors… it’s generally around 4 or 8 by default – increasing beyond the default isn’t a good idea).

1 Like

Thank you both @Research_Associate and @petebankhead for the huge help you are giving me!

I’m attaching here the error print screen.

The images have a size of about 413 mm2 each…

Thanks a lot for the help!

Thanks @biancatroncarelli, it’s definitely a memory problem then.

The ‘Requested pixel size’ value you have specified is extremely small. QuPath may be overriding this request since it is so small, but I suggest leaving it at its default value instead (usually 0.5).

The fact that there is a classifier training window open with ‘Live update’ selected while still running cell detection is probably also not helping – it’s best to detect cells first, then train a classifier afterwards.

View → Show memory monitor is a useful command to visualize when you might be approaching the limits of the memory you have available for QuPath. But in any case the amount you can do will depend upon how much RAM you have in your computer (and how much of it you have made available to QuPath, via Help → Show setup options).

Note that if you want the tumor/stromal percentage in terms of area then you don’t need to detect cells at all – you can try pixel classification instead. Alternatively, you can use cell detection + cell classification if you want the percentage in terms of cell counts.

2 Likes

All of the things Pete said, and one more. If you are drawing annotations up to each other, but do not want them to overlap, there is a key command for that. On PC it is CTRL+SHIFT then left click to draw. I assume on mac it would be Apple+Shift?

That should help prevent double counting areas.

I very much agree that if simply counting area, the pixel classifier is probably your best bet. If you need percentage of cells, then you might need to keep troubleshooting.

1 Like

Thank you so much @petebankhead and @Research_Associate!

Definitely the tool for pixel classification it works perfectly for what we need (percentage of tumor and normal tissue), and I’m not having trouble with the memory of the computer (the only thing I did it was to divide the project in order to avoid too many slides being analysed on the same project).

Thanks a lot!

1 Like