Class OpenCLAlgorithmLaplacian

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

    public class OpenCLAlgorithmLaplacian
    extends OpenCLAlgorithmBase
    OpenCL Algorithm computes the Laplacian of a 2D, 3D or 4D image.
    • Field Detail

      • amplificationFactor

        private float amplificationFactor
        An amplification factor greater than 1.0 causes this filter to act like a highpass filter.
      • GxxData2D

        private float[] GxxData2D
        Storage location of the second derivative of the Gaussian in the X direction for the 2D kernel.
      • GyyData2D

        private float[] GyyData2D
        Storage location of the second derivative of the Gaussian in the Y direction for the 2D kernel.
      • GxxData

        private float[] GxxData
        Storage location of the second derivative of the Gaussian in the X direction for the 3D kernel.
      • GyyData

        private float[] GyyData
        Storage location of the second derivative of the Gaussian in the Y direction for the 3D kernel.
      • GzzData

        private float[] GzzData
        Storage location of the second derivative of the Gaussian in the Z direction for the 3D kernel.
      • kExtents_2D

        private int[] kExtents_2D
        Extents of the 2D kernel.
      • kOrigins_2D

        private int[] kOrigins_2D
        Origins of the 2D kernel.
      • kExtents_3D

        private int[] kExtents_3D
        Extents of the 3D kernel.
      • kOrigins_3D

        private int[] kOrigins_3D
        Origins of the 3D kernel.
      • sigmas

        private float[] sigmas
        Standard deviations of the gaussian used to calculate the kernels.
    • Constructor Detail

      • OpenCLAlgorithmLaplacian

        public OpenCLAlgorithmLaplacian​(ModelImage srcImg,
                                        float[] sigmas,
                                        boolean maskFlag,
                                        boolean separable,
                                        boolean img25D,
                                        float ampFactor)
        Constructs a Laplacian algorithm object.
        Parameters:
        srcImg - source image model
        sigmas - Gaussian's standard deviations in the each dimension
        maskFlag - Flag that indicates that the Laplacian will be calculated for the whole image if equal to true
        img25D - Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.
        ampFactor - An amplification factor greater than 1.0 causes this filter to act like a highpass filter.
      • OpenCLAlgorithmLaplacian

        public OpenCLAlgorithmLaplacian​(ModelImage destImg,
                                        ModelImage srcImg,
                                        float[] sigmas,
                                        boolean maskFlag,
                                        boolean separable,
                                        boolean img25D,
                                        float ampFactor)
        Constructs a Laplacian algorithm object.
        Parameters:
        destImg - image model where result image is to stored
        srcImg - source image model
        sigmas - Gaussian's standard deviations in the each dimension
        maskFlag - Flag that indicates that the Laplacian will be calculated for the whole image if equal to true
        img25D - Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.
        ampFactor - An amplification factor greater than 1.0 causes this filter to act like a highpass filter.
    • Method Detail

      • genLevelMask

        public static void genLevelMask​(int xDim,
                                        int yDim,
                                        float[] buffer,
                                        java.util.BitSet edgeImage,
                                        float level)
        Generates a zero crossing mask for a 2D function sets a Bitset object to 1 is a zero crossing is detected.
        Parameters:
        xDim - X dimension length
        yDim - Y dimension length
        buffer - array of data in which to find level crossing
        edgeImage - edge map of level crossings
        level - level of crossings to find (e.g. zero crossing of the Laplacian)
      • makeKernels2D

        private void makeKernels2D()
        Creates Gaussian derivative kernels.
      • makeKernels3D

        private void makeKernels3D()
        Creates Gaussian derivative kernels.
      • laplacian25D

        private void laplacian25D()
        2D Implementation: Create the OpenCL Buffers, Kernel, and CommandQueue. Run the Kernel and save the results into a new image.
      • laplacianSep25D

        private void laplacianSep25D()
      • laplacianSep25DSlices

        private void laplacianSep25DSlices()
      • laplacian3D

        private void laplacian3D​(int time)
        3D Implementation: Create the OpenCL Buffers, Kernel, and CommandQueue. Run the Kernel and save the results into a new image.
      • laplacianSep3D

        private void laplacianSep3D​(int time)
      • laplacian4D

        public void laplacian4D()
        Calls laplacian3D for each volume in the time series image.