|
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
|