Flip axis or change axis origin


I have a question regarding the Napari Viewer axis system.
Is there a way to change the axis origin respectively flip the y-axis?
As of today, I can find only the solution to use np.flip before adding the image.
The obvious problem with this solution is, that coordinates shown in the viewer do no longer correspond to the original image.

Is there a more elegant way, integrated into napari?
If not would this be possible as a feature?

Best regards,

Hello! There is a slightly roundabout way that could probably be better documented, but you can pass a negative scale for the corresponding axis and that axis will be flipped on the viewer:

from skimage import data
import napari

with napari.gui_qt():
    # create the viewer with an image
    viewer = napari.view_image(data.astronaut(), rgb=True, scale=[1, -1])
    viewer.axes.visible = True

Thanks a lot!

This is exactly the solution is was looking for.

It doesn’t look like the axes visual got flipped did it? See here for default add_image

[EDIT: I guess that’s to be expected, as we’re just using scale, but we could think of ways to change that if people wanted special modes etc, not sure that’s necessary though]