Tiny QOL suggestion - Set magnification

Hi Pete and Melvin, I hope that you’re well.

I just want to put in a tiny quality of life suggestion regarding the Set magnification option, that is to automatically select and highlight the number in the “Enter magnification” field.
image

As it is currently, the user has to manually select and delete the current magnification shown in the field to change the magnification to the desired value. Having the numbers in the field pre-highlighted for quicker input of a new value would be a slight QOL improvement.

I understand this is a very nitpicky change to suggest, so it probably wouldn’t be a priority.

I hope that this and other small suggestions would be welcome!

Best wishes,
Yau

Hi @ym.lim,

This seems to be a small enough change, I’ll write it down in our ’todo list’ and will try to get it into the next version of QuPath! Thanks for the suggestion.

Best,

Melvin

2 Likes

Hi Melvin, is there a way to set magnification with a script? Also might be an idea to have an adjustable default magnification in settings?
I like to create my annotations by setting the magnification to 0.2x then using the brush tool to create multiple equal sized circular annotations. Its a fast way to make annotations but could be quicker if I could automate the magification setting.
All the best,
Alan

1 Like

Hi Alan,

Yes, you can set the magnification with the following script:

double value = 1.0  // Your value
getCurrentViewer().setMagnification(value)
2 Likes

I wanted to point out that once you have created a single one of those annotations, you can use Shift+D to duplicate it and move the duplicate - and repeat however many times you want.

And if you leave that annotation selected when moving to a new image, you can use Shift+E on the new image to get a first instance of it… then Shift+D all over again.

1 Like

Brilliant, thanks both :slight_smile:

2 Likes

…it does work but seems to throw up this error and the log window

ERROR: QuPath exception: Not on FX application thread; currentThread = richscripteditor-1

Ah, whenever you see this error message you can try to wrap your code in Platform.runLater(() -> {...}), like this:

Platform.runLater(() -> {
    double value = 1.0  // Your value
    getCurrentViewer().setMagnification(value)
})
3 Likes

Using the magnification isn’t normally a good way to define things, since it is completely non-standardized across scanners / microscopes in terms of how it relates to sizes in the image – that’s why QuPath doesn’t rely on it (except perhaps for a few very old commands), see here for a bit more info.

The way I’d recommend doing what you describe is with Object → Annotations… → Specify annotation… to create a rectangle or circle/ellipse of a fixed size. You can then shift it to the location you want. And, as @Research_Associate says, once you have one you can use Shift + D to duplicate it. I use this approach myself often, and it should give a lot more control than using the brush.

(There are other tricks… you might also use the Points tool and then Objects → Annotations… → Expand annotations… followed by Split annotations to create your circular annotations with a fixed size).

1 Like

works nicely, thanks again :slight_smile:

thanks, thats good to know

In my use case that led me to post this in the first place, the sensitivity of the Wand tool is dependent on the magnification. I am using it to manually annotate some ROIs, and I would like to have a consistent sensitivity between images in a project.