ome / omero-iviewer

An OMERO.web app allowing to view images
https://www.openmicroscopy.org/omero/iviewer/
Other
19 stars 30 forks source link

Zoom by Objective Magnification. 40x, 10x #315

Open will-moore opened 4 years ago

will-moore commented 4 years ago

See https://forum.image.sc/t/a-couple-of-queries-about-omero-iviewer/36144

"In iviewer, is there any way of zooming in/out of the image using the microscope objective magnifications![ (10x, 40x) rather than the %?"

JavascriptMick commented 2 years ago

+1 this would be very intuitive for Pathologists.

JavascriptMick commented 2 years ago

@will-moore is there a relationship between the % magnification and the objective values?

will-moore commented 2 years ago

For the built-in web viewer, which uses PanoJS, we listen for zoom events and (if the image has a NominalMagification metadata e.g. the image was acquired on a 40 X lens) then we use that to say "If the image is at 100% (scale = 1) then show Magnification 40 x". If you zoom out to 50%, the label will say 20 x:

https://github.com/ome/omero-web/blob/64f065db3c336aa648f66999e8bf4e9db800b42b/omeroweb/webgateway/static/webgateway/js/ome.viewportImage.js#L507

e.g. https://idr.openmicroscopy.org/webgateway/img_detail/14000892/?zm=100&x=25528.5&y=39043.5

However, this doesn't affect the Zoom in/out controls - it's just a label to show current zoom in a different way.

I guess we could either do the same in iviewer (add a Magnification 40 x label) or try and update the zoom controls to allow a user to enter a value like 20 x instead of 50 % as you can now:

Screenshot 2022-09-05 at 13 22 58