private double[] acquireRoiFromUser(final CanvasFrame monitorWindow,
final double monitorWindowScale) throws Exception {
if (monitorWindow == null) {
throw new Exception("Error: No monitor window. Could not acquire ROI from user.");
}
Toolkit t = Toolkit.getDefaultToolkit();
Dimension d = t.getBestCursorSize(15, 15);
BufferedImage cursorImage = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = cursorImage.createGraphics();
int cx = d.width/2, cy = d.height/2;
g.setColor(Color.WHITE); g.drawRect(cx-7, cy-7, 14, 14);
g.setColor(Color.BLACK); g.drawRect(cx-6, cy-6, 12, 12);
g.setColor(Color.WHITE); g.drawRect(cx-2, cy-2, 4, 4);
g.setColor(Color.BLACK); g.drawRect(cx-1, cy-1, 2, 2);
if (d.width%2 == 0) {
cx += 1;
}
if (d.height%2 == 0) {
cy += 1;
}
Cursor cursor = t.createCustomCursor(cursorImage, new Point(cx, cy), null);
monitorWindow.setCursor(cursor);
final double[] roiPts = new double[8];
final int[] count = { 0 };
monitorWindow.getCanvas().addMouseListener(new MouseAdapter() {