finding the center of an oval selection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

finding the center of an oval selection

Neil Fazel
Is there a way to find the coordinates of the center pixel of an oval selection?

I know that when drawing a circle using the Oval Selection Tool, the tool displays the coordinates of the upper left hand corner of the enclosing square, as well as the circle diameter, and from these the center pixel coordinates can be calculated. But is there a direct way to get the center pixel coordinates?

Thanks,
Neil

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: finding the center of an oval selection

Cammer, Michael
I think that when a ROI is added to the ROI Manager the numbers are the center of the ROI.  For instance, a ROI 0002-0145-0272 is in slice 2 of a stack and the center is at X= 272, Y= 145.

Also, Analyze > Set Measurements > Centroid will return the X, Y center of a ROI when measured.  But this returns the distance in units that are defined (for instance um) unless specified uncalibrated (but I don't remember how to turn off the spatial calibration without going into image properties or set scale).

Regards,

Michael

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Neil Fazel
Sent: Thursday, March 07, 2013 4:53 PM
To: [hidden email]
Subject: finding the center of an oval selection

Is there a way to find the coordinates of the center pixel of an oval selection?

I know that when drawing a circle using the Oval Selection Tool, the tool displays the coordinates of the upper left hand corner of the enclosing square, as well as the circle diameter, and from these the center pixel coordinates can be calculated. But is there a direct way to get the center pixel coordinates?

Thanks,
Neil

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: finding the center of an oval selection

Neil Fazel
In reply to this post by Neil Fazel
Thanks. Both methods work.

Neil

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: finding the center of an oval selection

Viplav Abhiyan
In reply to this post by Cammer, Michael
Dear Michael,

I have a query, it would be great if you could help me.

I would like to know how can I make a oval shape of defined radius from the co-ordinates obtained from another macros in Image J.

I have used this macro for obtaining the co-ordinates:

if( s == -1 ) {
    exit("There was no selection.");
} else if( s != 10 ) {
    exit("The selection wasn't a point selection.");
} else {
    getSelectionCoordinates(xPoints,yPoints);
    x = xPoints[0];
    y = yPoints[0];
    showMessage("Got coordinates ("+x+","+y+")");

}

Now the question is how can I make a circle of defined radius using the co-ordinates (x, y). Please let me know. That would be really helpful.

Thanks, Best Regards, Abhiyan