Recording coordinates of PointROI in Micro-Manager

I am building a MM plugin and I would like to know how to access the coordinates of a PointROI using the micro-manager API.
Currently I have the following

ImagePlus ip = WindowManager.getCurrentImage();
ij.gui.PointRoi r = (ij.gui.PointRoi)ip.getRoi();
int[] x = r.getXCoordinates();
int[] y = r.getYCoordinates();

but the values in x and y don’t correspond to my point selection.

Thanks

Hi @SRud, welcome to this forum!

The following Beanshell script worked for me:

import ij.ImagePlus;
import ij.WindowManager;

ImagePlus ip = WindowManager.getCurrentImage();
ij.gui.Roi roi = ip.getRoi();
int x = roi.getBounds().getX();
int y = roi.getBounds().getY();
mm.scripter().message("" + x + ", " + y);

However, it only works on the Snap/Live and Album windows, i.e. not on a multi color MDA window. This has something to do with Micro-Manager doing most of the display code itself.

Thanks. This would work for a single point. Is there a method to get the list of coordinates when there are multiple point selections?

May be better to tag this as an ImageJ question. This needs understanding of the ImageJ apis rather than Micro-Manager.