Skip to content

Tips and tricks

pete edited this page Jul 17, 2018 · 1 revision

This section contains a (growing) list of tips for working with QuPath effectively - mostly by using shortcuts or not-entirely-obvious features and options.

Find commands quickly

Pressing Ctrl + L (or Cmd + L on a Mac) brings up the Command List. This is a much more effective way to find commands than searching through the menus. It is described under Getting help.

Fast navigation

Multi-touch gestures

If you have a trackpad or touch-sensitive mouse, experiment with the options under Tools → Multi-touch gestures. My preference is to turn on Use scroll gestures only. This means the swipes and scroll gestures no longer zoom in or out unless the Shift key is held down; if it is not, then they result in fast navigation across the slide.

Navigating with shortcut keys

Whenever the viewer is in focus, the arrow keys can also be used to navigate around the slide. If Shift is held down, the up and down arrow keys can also be used to zoom in and out.

For a TMA slide that has been dearrayed, the arrow keys switch to moving around the slide one core at a time - selecting and centering each core.

Fast annotations

Use shortcut keys

It's essential to become familiar with the shortcut keys to annotate an image quickly. All of the main drawing tools have shortcuts, which can be seen in the Tools menu. Many of them are simply the first letter of the tool, i.e. r for rectangle, p for polygon, b for brush. m for move is particularly important.

Zoom in & out while using the Brush tool

By default, the width of the Brush tool depends upon the magnification at which the image is being viewed. This can be changed in the Preferences , but it is probably best leave it as it is - because allowing the Brush tool to be zoom-dependent means that it is often the only tool you need when annotating many regions across an image. Not only can it be used to draw arbitrarily complex shapes, but pressing the Alt key while drawing with the Brush can also be used to remove regions from an annotation as well.

When this is combined with multi-touch gestures it becomes even more effective.

Use the Wand tool for areas of high contrast

The Wand tools is most useful for annotating areas that contrast highly with their surroundings. For example, areas of strong positive staining surrounded by negative staining can be selected extremely quickly with judicious use of the Wand. So too can areas of tissue surrounded by background, or even individual nuclei. The key is to keep in mind at the Wand tool is (by default) zoom-dependent - just like the Brush tool. Therefore before using it, you should zoom to a magnification where the area you want to draw around is fairly homogenous, and clearly distinct from the surroundings.

Annotating tiles

When identifying regions based on classifying tiles, consider switching on the Tile brush option in the Preferences . Whenever you click on a tile, this will then result in a ROI being created that exactly covers the tile - rather than simple a circle. As you hold down the mouse and drag across the image, more tiles are added to the annotation as required.

Classifying quickly

Setting annotation classes

Remember there are various ways to set annotation classifications - the quickest being to hold down shift while right-clicking on a new annotation to bring up the 'circle menu'.

Set class of annotation by shift + right-click

Annotate with restraint

When training a detection classifier, it can be tempting to select large 'easy' areas - and neglect fiddly, awkward areas that are harder to draw around. Don't! This can horribly bias the training data, and will harm performance. It will also mean that training may be slower, because it is based on a huge amount of training data... although much of it is the same.

Select features cautiously

It can be tempting to just create classifiers using all available features and default settings. That may be ok, but it's unlikely to be 'best'. Consider looking through the features (under the Advanced options), and choosing them more cautiously. If some features are highly correlated with others (e.g. perimeter and area), it may be best to choose only one of these.

You might also consider using a tool such as Weka to help perform feature selection. The QuPath Weka Extension can help you get your data into the right format.

Delete unnecessary features entirely

If you identify that certain features are not needed, consider removing them entirely. This will mean that QuPath needs less memory, and may perform better - and give smaller file sizes. This can be done using the Measure → Show measurement manager command.

However, it is essential that you don't use features for classification in one image which are unavailable (or deleted) in an other image where the classifier will be used. The classification may still run - but is unlikely to perform very well.

Sub-sample where necessary

Classification is often very fast whenever few training objects are available, but may slow down considerably as more training annotations are created. In this case, consider subsampling the training data. This can be done by reducing the Training set split value under Advanced options. Setting this to 50% will mean that only half the detections falling inside your annotations will be used for training. However, very often this is not a bad thing since many of the detections are similar to one another - indeed, often they fall next to one another in the same annotation, and probably have very similar features. So not much is lost this way, and classification speed may improve considerably.

Clone this wiki locally