Freehand Line Coordinates

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

Freehand Line Coordinates

AdamC
Hi,

I'm trying to get co-ordinates for all of the points of a free hand  
line.

I've tried the approach below based on a suggestion of Wayne for  
getting all the coordinates of an ROI.
However the length of the line doesn't match up with the number of  
coordinates returned.
Does anyone have any suggestions?

run("Select None");
setTool(6);
waitForUser("draw a line");
print("\\Clear");
run("Set Measurements...", "area redirect=None decimal=0");
run("Measure");

run("Fit Spline", "straighten");
getSelectionCoordinates(xCoord, yCoord);
Length=getResult("Length");
nPoints=xCoord.length;

print ("Line is " + Length + " pixels long. " + nPoints + "  
coordinates found");

//for(a=0; a<xCoord.length; a++)print(a+1,xCoord[a],yCoord[a]);


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