Class OpenCLAlgorithmGradientMagnitude

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

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

      • Gx2Data

        private float[] Gx2Data
        Storage location of the first derivative of the Gaussian in the X direction for 2D images;
      • GxData

        private float[] GxData
        Storage location of the first derivative of the Gaussian in the X direction.
      • Gy2Data

        private float[] Gy2Data
        Storage location of the first derivative of the Gaussian in the Y direction for 2D images;
      • GyData

        private float[] GyData
        Storage location of the first derivative of the Gaussian in the Y direction.
      • GzData

        private float[] GzData
        Storage location of the first derivative of the Gaussian in the Z direction.
      • 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

      • OpenCLAlgorithmGradientMagnitude

        public OpenCLAlgorithmGradientMagnitude​(ModelImage srcImg,
                                                float[] sigmas,
                                                boolean maskFlag,
                                                boolean separable,
                                                boolean img25D)
        Creates a new AlgorithmGradientMagnitude object.
        Parameters:
        srcImg - source image model
        sigmas - Gaussian standard deviations in each dimension
        maskFlag - Flag, if true, indicates that the gradient magnitude will be calculated for the whole image
        img25D - Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.
      • OpenCLAlgorithmGradientMagnitude

        public OpenCLAlgorithmGradientMagnitude​(ModelImage destImg,
                                                ModelImage srcImg,
                                                float[] sigmas,
                                                boolean maskFlag,
                                                boolean separable,
                                                boolean img25D)
        Creates a new AlgorithmGradientMagnitude object.
        Parameters:
        destImg - image model where result image is to stored
        srcImg - source image model
        sigmas - Gaussian standard deviations in each dimension
        maskFlag - Flag, if true, indicates that the gradient magnitude will be calculated for the whole image
        img25D - Flag, if true, indicates that each slice of the 3D volume should be processed independently. 2D images disregard this flag.
    • Method Detail

      • makeKernels2D

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

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

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

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

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

        private void gradientMagnitudeSep25DSlices()
      • gradientMagnitudeSep3D

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

        private void gradientMagnitude4D()
        Calls gradientMagnitude3D for each volume in the time series.