Re: geometric challenge :)
Posted by
Gabriel Landini on
URL: http://imagej.273.s1.nabble.com/Macro-code-to-fit-a-spline-to-two-segments-tp5009069p5009358.html
On Tuesday 26 Aug 2014 16:50:48 Rasband, Wayne [E] wrote:
> Hard to believe but the following macro, which calculates the line length by
> summing the lengths of the segments, reports the same lengths as the
> Measure command. There are 3 segments in the base line and 352 in the
> spline fitted version.
[...]
Thanks Wayne. Yes, this is counter-intuitive. I tried drawing the selection
and the fitted splines and measure the length of the chain of pixels using
Lines8 (which overestimates lengths as it measures from pixel to pixel). I get
the same length for both curves: 758.056. Also interesting is that both curves
have exactly the same number of pixels (670).
I suppose that this is due to the approximation of the curve with segments?
The analytical solution to the length of the spline and the length of the
segments determined by the 3 points cannot be the same.
Cheers
Gabriel
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html