Class AlgorithmWSinc

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmWSinc
    extends AlgorithmBase
    Sinc function windowed with Hanning window function used for interpolation This function will create images with greater maximums and lower minimums than the original image, so if the input image type is BYTE or UBYTE, the output image type should be a SHORT. Notice that clamping to 0 and 255 is used with ARGB images.

    This is an example of a cardinal basis function. The cardinal basis function centered at a given original grid point is the definition of how an image that is 1 at that grid point and 0 at all others is to be interpolated into intermediate points. The final image is then constructed by adding together all the basis functions from each original grid point, each one scaled by the intensity at its original grid point. Since a cardinal basis function is zero at all other original grid points except the one at which it is based, interpolation that falls exactly onto an original grid point will always preserve the original value.

    • Field Detail

      • 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!
      • rX

        private int rX
        DOCUMENT ME!
      • rY

        private int rY
        DOCUMENT ME!
      • rZ

        private int rZ
        DOCUMENT ME!
      • scaleX

        private double scaleX
        DOCUMENT ME!
      • scaleY

        private double scaleY
        DOCUMENT ME!
      • scaleZ

        private double scaleZ
        DOCUMENT ME!
      • sliceSize

        private int sliceSize
        DOCUMENT ME!
      • volume

        private double[] volume
        Global variables.
      • wSincXT

        private double[] wSincXT
        DOCUMENT ME!
      • wSincYT

        private double[] wSincYT
        DOCUMENT ME!
      • wSincZT

        private double[] wSincZT
        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 Detail

      • AlgorithmWSinc

        public AlgorithmWSinc()
        AlgorithmWSinc - default constructor.
    • Method Detail

      • 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
      • setup2DWSinc

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

        public void setup2DWSinc​(double[] vol,
                                 int[] extents,
                                 int[] range,
                                 boolean clip)
        Setup 2D wSinc.
        Parameters:
        vol - volume comprising control points for the wSinc
        extents - vol extents (xdim, ydim)
        range - determines number of pixels used along each axis
        clip - if true clip output to range of input image
      • setup2DWSincC

        public void setup2DWSincC​(double[] vol,
                                  int[] extents,
                                  float argbMax,
                                  boolean clip)
        Setup 2D wSinc for coor image.
        Parameters:
        vol - volume comprising control points for the wSinc
        extents - vol extents (xdim, ydim)
        argbMax - maximum possible color value
        clip - if true clip output to range of input image
      • setup3DWSinc

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

        public void setup3DWSinc​(double[] vol,
                                 int[] extents,
                                 int[] range,
                                 boolean clip)
        Setup 3D wSinc.
        Parameters:
        vol - volume comprising control points for the wSinc
        extents - vol extents (xdim, ydim, zdim)
        range - determines number of pixels used along each axis
        clip - if true clip output to range of input image
      • setup3DWSincC

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

        public double wSinc2D​(double x,
                              double y)
        2D windowed sinc function.
        Parameters:
        x - double point index
        y - double point index
        Returns:
        the wSinc2D interpolated data point
      • wSinc2DC

        public double[] wSinc2DC​(double x,
                                 double y)
        2D windowed sinc function for color.
        Parameters:
        x - double point index
        y - double point index
        Returns:
        the wSinc2D interpolated data point
      • wSinc3D

        public final double wSinc3D​(double x,
                                    double y,
                                    double z)
        3D windowed sinc function.
        Parameters:
        x - double point index
        y - double point index
        z - double point index
        Returns:
        the wSinc3D interpolated data point
      • wSinc3DC

        public double[] wSinc3DC​(double x,
                                 double y,
                                 double z)
        3D windowed sinc function for color (3 channel images).
        Parameters:
        x - double point index
        y - double point index
        z - double point index
        Returns:
        the wSinc3D interpolated data point