Class AlgorithmCubicLagrangian

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmCubicLagrangian
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class AlgorithmCubicLagrangian extends AlgorithmBase
This is a polynomial p of degree 3 which interpolates a given function f at the points x(-1), x(0), x(1), and x(2), and is given by p(x) = sum from i = -1 to i = 2 of li(x)*f(xi), where li, i = -1,0,1,2, which are called the fundamental polynomials, are given by li(x) = product from k = -1 to k = 2 for k != i of (x - xk)/(xi - xk). li(-1) = (x - 0)/(-1 - 0) * (x - 1)/(-1 - 1) * (x - 2)/(-1 - 2) = (x * (1-x) * (x-2))/6 li(0) = (x - -1)/(0 - -1) * (x - 1)/(0 - 1) * (x - 2)/(0 - 2) = ((x+1) * (x-1) * (x-2))*0.5 li(1) = (x - -1)/(1 - -1) * (x - 0)/(1 - 0) * (x - 2)/(1 - 2) = (x * (x+1) * (2-x))*0.5 li(2) = (x - -1)/(2 - -1) * (x - 0)/(2 - 0) * (x - 1)/(2 - 1) = (x * (x+1) * (x-1))/6
  • Field Details

    • alphaMax

      private double alphaMax
      DOCUMENT ME!
    • alphaMin

      private double alphaMin
      DOCUMENT ME!
    • blueMax

      private double blueMax
      DOCUMENT ME!
    • blueMin

      private double blueMin
      DOCUMENT ME!
    • clip

      private boolean clip
      DOCUMENT ME!
    • greenMax

      private double greenMax
      DOCUMENT ME!
    • greenMin

      private double greenMin
      DOCUMENT ME!
    • inputMax

      private double inputMax
      DOCUMENT ME!
    • inputMin

      private double inputMin
      DOCUMENT ME!
    • redMax

      private double redMax
      DOCUMENT ME!
    • redMin

      private double redMin
      DOCUMENT ME!
    • sliceSize

      private int sliceSize
      DOCUMENT ME!
    • volume

      private double[] volume
      DOCUMENT ME!
    • wt

      private double[][] wt
      DOCUMENT ME!
    • xD

      private int xD
      DOCUMENT ME!
    • yD

      private int yD
      DOCUMENT ME!
    • zD

      private int zD
      DOCUMENT ME!
    • xdim

      private int xdim
      DOCUMENT ME!
    • ydim

      private int ydim
      DOCUMENT ME!
    • zdim

      private int zdim
      DOCUMENT ME!
  • Constructor Details

    • AlgorithmCubicLagrangian

      public AlgorithmCubicLagrangian()
      AlgorithmCubicLagrangian - default constructor.
  • Method Details

    • cubicLagrangian2D

      public double cubicLagrangian2D(double x, double y)
      2D cubic Lagrangian function.
      Parameters:
      x - double point index
      y - double point index
      Returns:
      the cubic Lagrangian interpolated data point
    • cubicLagrangian2DC

      public double[] cubicLagrangian2DC(double x, double y)
      2D cubic Lagrangian function for color.
      Parameters:
      x - double point index
      y - double point index
      Returns:
      the cubic Lagrangian interpolated data point
    • cubicLagrangian3D

      public final double cubicLagrangian3D(double x, double y, double z)
      3D cubic Lagrangian function.
      Parameters:
      x - double point index
      y - double point index
      z - double point index
      Returns:
      the cubicLagrangian3D interpolated data point
    • cubicLagrangian3DC

      public double[] cubicLagrangian3DC(double x, double y, double z)
      3D cubic Lagrangian function for color (3 channel images).
      Parameters:
      x - double point index
      y - double point index
      z - double point index
      Returns:
      the cubicLagrangian3D interpolated data point
    • finalize

      public void finalize()
      Calls garbage collector to release system resources.
      Overrides:
      finalize in class AlgorithmBase
    • runAlgorithm

      public void runAlgorithm()
      default method that is not really appropiate for this class but must be defined because this class extends AlgorithmBase.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • setup2DCubicLagrangian

      public void setup2DCubicLagrangian(double[] vol, int[] extents, boolean clip)
      Setup 2D cubicLagrangian.
      Parameters:
      vol - volume comprising control points for the cubic Lagrangian
      extents - vol extents (xdim, ydim)
      clip - if true clip output to range of input image
    • setup2DCubicLagrangianC

      public void setup2DCubicLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip)
      Setup 2D cubicLagrangian for color.
      Parameters:
      vol - volume comprising control points for the cubic Lagrangian
      extents - vol extents (xdim, ydim)
      argbMax - maximum possible value of a color
      clip - if true clip output to range of input image
    • setup3DCubicLagrangian

      public void setup3DCubicLagrangian(double[] vol, int[] extents, boolean clip)
      Setup 3D cubic Lagrangian.
      Parameters:
      vol - volume comprising control points for the cubic Lagrangian
      extents - vol extents (xdim, ydim, zdim)
      clip - if true clip output to range of input image
    • setup3DCubicLagrangianC

      public void setup3DCubicLagrangianC(double[] vol, int[] extents, float argbMax, boolean clip)
      Setup 3D cubic Lagrangian for color.
      Parameters:
      vol - volume comprising control points for the cubic Lagrangian
      extents - vol extents (xdim, ydim, zdim)
      argbMax - maximum possible value for a color
      clip - if true clip output to range of input image