Dear Ethan,
The way to recover the necessary info from the ellipse is to measure it on the image using either the run("Measure") command or List.setMeasurements as per the demo by Wayne
http://imagej.nih.gov/ij/macros/DrawEllipse.txt if (selectionType==-1)
exit("Area selection required");
List.setMeasurements;
//print(List.getList); // list all measurements
x = List.getValue("X");
y = List.getValue("Y");
a = List.getValue("Major");
b = List.getValue("Minor");
angle = List.getValue("Angle");
print(x,y,a, b,angle);
If you want to ask the user to draw an ellipse interactively and do not need the angle, you can use
run("Specify...") that will show a menu where the user can enter the values
You then need to use the method above to recover the data.
Another way is to let the user draw using
setTool("ellipse");
waitForUser("Please draw an ellipse and press OK");
And use the method above once again to recover the information you need.
Finally if you want to prompt the user for a very specific set of coordinates, you can create a dialog.
Dialog.create("Make me an Ellipse");
Dialog.addNumber("X1");
Dialog.addNumber("Y1");
Dialog.addNumber("X2");
Dialog.addNumber("Y2");
Dialog.addNumber("Aspect Ratio");
Dialog.show();
x1 = Dialog.getNumber();
y1 = Dialog.getNumber();
x2 = Dialog.getNumber();
y2 = Dialog.getNumber();
ar = Dialog.getNumber();
// Now make the ellipse
run("makeEllipse...", x1, y1, x2, y2, ar);
But this is not interactive, so the user will not see if the coordinates are correct.
Hope this helps you..
Best
Oli
Olivier Burri
Image Analyst
BioImaging & Optics Platform
Ecole Polytechnique Federale de Lausanne
EPFL - SV - PTECH - BIOP
Lausanne, Switzerland
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html