X,y transposition coordinates from .json file used to display image in OMERO.Figure

How do you get an ndarray of an image as it is displayed in OMERO.Figure (zoomed and shifted), from coordinates in the .json file. I see the zoom factor, but I don’t see any numbers for x,y transposition that make sense.

For example, I don’t see ‘531’ or ‘669’ anywhere in the .json file for the image below. How are those coordinates stored/calculated?

json file is attached for reference. The displayed image ID is 556939

OMERO_Figure.txt (53.5 KB)

Hi Josh,
I’m afraid the way that figure does this is a little obscure. It uses the parameters that you can control (panning (dx, dy), zoom, and the viewport aspect ratio to calculate the ‘bounding box’.
The function you want is called getViewportAsRect here:

The various parameters it uses should all be found in the figure JSON you’re working from.
Hope that makes sense?


1 Like

Yep, that worked. Thank you Will!