# How can I circumscribe an ellipse to an image by imagej macro?

I need to circumscribe an ellipse to an image in macro and then section it to 4 (crossing the largest and smallest diameter) and add one of those 4 sections to ROI.
Any idea of how?
I have some sample images to give you a hint of how it might look:

What is the geometric shape of your image?

an imagecould help us.

1 Like

Do you need an ellipse? If yes, why?
Why not use â€śConvex Hullâ€ť?

``````
run("8-bit");
setAutoThreshold("Huang dark");
//run("Threshold...");
//setThreshold(9, 255);
run("Fill Holes");
roiManager("Select", 0);
run("Convex Hull");
``````
1 Like

To select the cells:
run(â€śThresholdâ€¦â€ť);
//setTool(â€śwandâ€ť);
doWand(84, 297);
doWand(498, 193);
doWand(840, 188);
doWand(90, 620);

To draw the ellipses & quadrants:
https://imagej.nih.gov/ij/macros/DrawEllipse.txt

What is it you really want to do?
Cheers-
michael.cammer@nyulangone.org

Who is the question for?
If it concerns â€śconvex hullâ€ť then:

Convex Hull

Replaces a polygon of freehand selection with its convex hull, which can be thought of as a rubber band wrapped tightly around the points that define the selection.

``````https://imagej.nih.gov/ij/docs/menus/edit.html
``````

Iâ€™m curious about the method you used to create the ROI selection. How can I select such smooth ROI around the cell boundary.

Many thanks for your reply. Iâ€™m aware of convex hull. But I was wondering if @Mathew has the fully automatic selection method.

I found the Edit->Selection->Create selection