getSelectionCoordinates() not working properly with automatically generated ROIs

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

getSelectionCoordinates() not working properly with automatically generated ROIs

voidspaces
Hi everyone

Does anyone know why getSelectionCoordinates(x,y) in my code would return only 4 points' coordinates after creating an oval with makeOval(a,b,c,d)? The resulting 4 points I get are the corners of the oval's bounding rectangle.

If instead I run getSelectionCoordinates(x,y) on an oval selected manually I would get all the coordinates as expected.

Thank you in advance for your help.

Best
Gio
Reply | Threaded
Open this post in threaded view
|

Re: getSelectionCoordinates() not working properly with automatically generated ROIs

Rasband, Wayne (NIH/NIMH) [E]
On Jan 9, 2014, at 11:24 AM, voidspaces wrote:

> Hi everyone
>
> Does anyone know why getSelectionCoordinates(x,y) in my code would return
> only 4 points' coordinates after creating an oval with makeOval(a,b,c,d)?
> The resulting 4 points I get are the corners of the oval's bounding
> rectangle.
>
> If instead I run getSelectionCoordinates(x,y) on an oval selected manually I
> would get all the coordinates as expected.

This bug is fixed in the latest daily build (1.48p9), or you can work around it by using Edit>Selection>Interpolate, for example

   run("Interpolate", "interval=1");
   getSelectionCoordinates(x,y);

-wayne

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

Re: getSelectionCoordinates() not working properly with automatically generated ROIs

voidspaces
Thank you Wayne for your reply.
Good to know that they fixed it.
Anyway, I tried that workaround before but unfortunately it was not working.
I eventually found a solution using run("Specify...", "width="+a+" height="+b+" x="+c+" y="+d+" oval") where a,b,c,d are the same variables used in the creation of the oval.

Thank you again.
Giovanni
Reply | Threaded
Open this post in threaded view
|

Re: getSelectionCoordinates() not working properly with automatically generated ROIs

stephane
In reply to this post by Rasband, Wayne (NIH/NIMH) [E]
Hello Wayne,
I have the same problem with ImageJ1.49k. The problem occurs with a image stack where I made  wand selection on several images and then  interpolate it in roimanager to have a selection on all the images of the stack. Before interpolation each selection I drawn is well described with:
 getSelectionCoordinates(x, y);
     for (i=0; i<x.length; i++)
         print(i+" "+x[i]+" "+y[i]);
However after the interpolation, the same code gives me just 4 points.