Posted by
Rasband, Wayne (NIH/NIMH) [E] on
Oct 16, 2013; 9:42pm
URL: http://imagej.273.s1.nabble.com/Strange-results-after-Fit-Spline-tp5005151p5005210.html
On Oct 12, 2013, at 4:51 PM, Norbert Vischer wrote:
> Hello All,
>
> The "Fit Spline" algorithm gives strange results for segmented lines consisting of long and short segments. The macro below is an extreme example: Four points are arranged as straight horizontal line, thus one would expect that fitting a straight line would not change anything.
> However, the fitting procedure extends the line with U-turns: the measured length jumps from 201 to 300.3 pix, and the profile (which automatically employs fitting) includes two peaks that are not on the line.
>
> Meanwhile I found out that I can avoid the problem by uncommenting the line containing "Interpolate". But possibly ImageJ could avoid such unexpected behaviour in the first place.
> By the way, the problem above also occurs if an end-point is recorded twice (replace 101 by 100 in the demo).
Thanks to Michael Schmid, this bug is fixed in the ImageJ 1.48e daily build, available at
http://wsr.imagej.net/download/ij.jarYou will be able to upgrade using Help>Update ImageJ when the U.S. Government shutdown ends.
-wayne
> close("spline-test");
> newImage("spline-test", "8-bit ramp", 500, 500, 1);
> makeRectangle(80, 50, 4, 100);
> changeValues(0, 255, 255);
>
> xx = newArray(100, 101, 300, 301);
> yy = newArray(90, 90, 90, 90);
> makeSelection("polyline", xx, yy);
> waitForUser;
> run("Set Measurements...", "perimeter");
> run("Clear Results");
>
> run("Measure");
> //run("Interpolate", "interval=0.1");
> run("Measure");
>
> run("Fit Spline");
> run("Measure");
> run("Plot Profile");
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html