Re: Getting coordinates inside a ROI

Posted by Rasband, Wayne (NIH/NIMH) [E] on
URL: http://imagej.273.s1.nabble.com/Getting-coordinates-inside-a-ROI-tp5003250p5003260.html

On Jun 5, 2013, at 9:56 PM, Peter Mc wrote:

> Hi everyone;
>
> I am working in a plugin where the user can select different ROIs using a
> ROI manager,these ROIs could be different
> types(OvalRoi,Rectangle,Ellipse,etc). I need to get the coordinates of all
> the points inside the ROI; is trivial to get the perimeter coordinates but I
> cannot find a simple way for the points inside.
> My solution is using the method /contain/ and iterate over the perimeter
> coordinates.
>
> I think must be an easier way... Am I missing something?

Use a mask. There is an example at

   http://imagej.nih.gov/ij/plugins/calculate-mean.html

It is not easier than using contains() but it is much faster.

-wayne

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