Tile Information and Zoom Level

Hi everyone,
I want to extract the current ‘tile information’ and ‘zoom level’ of image in orbit, which i want to use for further processing. Maybe a groovy script which can extract this information. Please help
Kind regards,
Ayesha

Hi Ayesha,

Welcome to the forum! Could you give me a bit more information on what exactly you’re looking to do? It should certainly be possible to extract the info with a groovy script, and if I know more precisely what info you need I can provide some pointers.

Best,

Jon

I actually want to extract and store mouse positions alongwith the tile it is on and the zoom level of the image. This information will be needed for mouse tracking, for knowing that what areas does the pathologist focus or have visited

Dear @Ayesha_Munir,

ok, so first let’s get the currently focused image frame and embedded recognition frame:

ImageFrame iFrame = OrbitImageAnalysis.getInstance().getIFrame();
RecognitionFrame rf = iFrame.getRecognitionFrame();

now you can get the current scale with
rf.getScale()
and mouse position with
rf.getMousePosition()
Then you would need the viewport offset, image dimensions and tile size:
rf.viewPortOffset
and

rf.bimg.getImage().getWidth()
rf.bimg.getImage().getTileWidth()

(and some for height)

I think with that you could script something.
I recommend to use a proper IDE (e.g. IntelliJ) for it to get all the imports automatically.

Regards,
Manuel

Thankyou for fast reply. I will try it

Kind regards,
Ayesha

I want to access the mouse coordinates and image scale at all the time. When I try to access it using a loop, the system hangs and Orbit does not work. Please help me

you have to do this async, via
Swingworker.invokeLater(new Runnable(…))
Regards,
Manuel