Module ij
Package ij.measure

Class SplineFitter


  • public class SplineFitter
    extends Object
    This class interpolates a set of points using natural cubic splines (assuming zero second derivatives at end points). Given a set of knots x (all different and arranged in increasing order) and function values y at these positions, the class build the spline that can be evaluated at any point xp within the range of x. It is based on the publication Haysn Hornbeck "Fast Cubic Spline Interpolation" https://arxiv.org/abs/2001.09253 Implemented by Eugene Katrukha (katpyxa@gmail.com) to fit the layout of SplineFitter class of ImageJ
    • Constructor Detail

      • SplineFitter

        public SplineFitter​(int[] x,
                            int[] y,
                            int n)
      • SplineFitter

        public SplineFitter​(float[] x,
                            float[] y,
                            int n,
                            boolean closed)
        For closed curves: the first and last y value should be identical; internally, a periodic continuation with a few will be used at both ends
      • SplineFitter

        public SplineFitter​(float[] x,
                            float[] y,
                            int n)
    • Method Detail

      • evalSpline

        public double evalSpline​(double xp)
        Evalutes spline function at given point
      • evalSpline

        public double evalSpline​(int[] x,
                                 int[] y,
                                 int n,
                                 double xp)
        provides interpolated function value at position xp
      • evalSpline

        public double evalSpline​(float[] x,
                                 float[] y,
                                 int n,
                                 double xp)