roiManager("Reset"); setTool("Oval"); waitForUser("Make Oval"); roiManager("Add"); run("Line Width...", "line=2"); setTool("Line"); waitForUser("Make Line"); getLine(x1, y1, x2, y2, lineWidth); run("Line to Area"); rising = ((x2 - x1) * (y2 - y1)) < 0; roiManager("Add"); roiManager("AND"); getSelectionBounds(x, y, width, height); //makeRectangle(x, y, width, height);//optional xx1 = x; xx2 = x + width; if (rising){ yy1 = y + height; yy2 = y; } else{ yy1 = y; yy2 = y + height; } print("xx1=", xx1, "  yy1=", yy1, "  xx2=", xx2, "  yy2=", yy2);