Re: Pixel intensities at equidistant sample points along selection
Posted by Wayne Rasband on Nov 14, 2008; 3:13pm
URL: http://imagej.273.s1.nabble.com/Pixel-intensities-at-equidistant-sample-points-along-selection-tp3694489p3694490.html
On Nov 14, 2008, at 9:30 AM, Richard Mort wrote:
> Hi can anyone help me with this?
> I'd like to do a profile plot that returns pixel intensities at
> equidistant sample points along a selection and I'd like to be able to
> specify the distance.
The Edit>Selection>Fit Spline command, when called with a ""straighten"
option, converts a line selection to one with points spaced one pixel
apart. Here is an example:
newImage("Test", "8-bit Black", 480, 480, 1);
makeLine(77,81,186,97,246,165,248,236,180,310,88,292);
getSelectionCoordinates(x,y);
print("points: ", x.length);
run("Measure");
print("length: "+getResult("Length", nResults-1));
run("Fit Spline", "straighten");
getSelectionCoordinates(x,y);
print("points: ", x.length);
run("Measure");
print("length: "+getResult("Length", nResults-1));
-wayne