List all coordinates for an ROI

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

List all coordinates for an ROI

AdamC
Does anyone have a macro which will list all of the coordinates for  
an ROI?
(not just the ends of the vertices)

Thanks

Adam

Dr Adam Cliffe
Research Fellow
Rørth Lab
Cell Migration Group
Temasek Lifescience Laboratory
1 Research Link
National University of Singapore
Singapore 117604

tel: (65) 6872 8406
fax: (65) 6872 7007
Reply | Threaded
Open this post in threaded view
|

Re: List all coordinates for an ROI

Wayne Rasband
On Sep 24, 2008, at 6:29 AM, Adam Cliffe wrote:

> Does anyone have a macro which will list all of the coordinates for an
> ROI?
> (not just the ends of the vertices)

One way to do this is to run the Edit>Selection>Fit Spline command with
the "straighten" option, which is what the Edit>Selection>Straighten
command does to get coordinates along a line spaced one pixel apart.
Here is an example:

   requires("1.41i");
   run("Fit Spline", "straighten");
   getSelectionCoordinates(x, y);
   for (i=1; i<x.length; i++) {
       distance =
sqrt((x[i]-x[i-1])*(x[i]-x[i-1])+(y[i]-y[i-1])*(y[i]-y[i-1]));
       print(i, x[i], y[i], distance);
   }

-wayne