Class OpenCLAlgorithmGaussianBlur

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

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

      • GaussData_2D

        private float[] GaussData_2D
        Storage location of the 2D Gaussian kernel.
      • GaussData_3D

        private float[] GaussData_3D
      • 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.
      • colorMask

        private int[] colorMask
        Color flags.
      • sigmas

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

      • OpenCLAlgorithmGaussianBlur

        public OpenCLAlgorithmGaussianBlur​(ModelImage srcImg,
                                           float[] sigmas,
                                           boolean maskFlag,
                                           boolean separable,
                                           boolean img25D)
        Creates a new AlgorithmGaussianBlur object.
        Parameters:
        srcImg - the source image
        sigmas - the standard deviations of the Gaussian
        maskFlag - VOI Masking
        img25D - calculate per slice or for 3D volume
      • OpenCLAlgorithmGaussianBlur

        public OpenCLAlgorithmGaussianBlur​(ModelImage destImg,
                                           ModelImage srcImg,
                                           float[] sigmas,
                                           boolean maskFlag,
                                           boolean separable,
                                           boolean img25D)
        Constructor which sets the source and destination images, the minimum and maximum progress value.
        Parameters:
        destImg - the destination image
        srcImg - the source image
        sigmas - the sigmas
        maskFlag - the mask flag
        img25D - the 2.5D indicator
      • OpenCLAlgorithmGaussianBlur

        public OpenCLAlgorithmGaussianBlur​(ModelImage destImg,
                                           ModelImage srcImg,
                                           float[] sigmas,
                                           boolean maskFlag,
                                           boolean separable,
                                           boolean img25D,
                                           long deviceType)
        Constructor which sets the source and destination images, the minimum and maximum progress value.
        Parameters:
        destImg - the destination image
        srcImg - the source image
        sigmas - the sigmas
        maskFlag - the mask flag
        img25D - the 2.5D indicator
    • Method Detail

      • makeKernels2D

        private void makeKernels2D()
        Creates 2D Gaussian kernels for the blurring process. The kernel size is always odd and proportional (8X) to the standard deviation of the Gaussian.
      • makeKernels3D

        private void makeKernels3D()
        Creates 3D Gaussian kernels for the blurring process. The kernel size is always odd and proportional (8X) to the standard deviation of the Gaussian.
      • gaussianBlur25D

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

        private void gaussianBlurSep25D()
      • gaussianBlurSep25DSlices

        private void gaussianBlurSep25DSlices()
      • gaussianBlur3D

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

        private void gaussianBlurSep3D​(int time)
      • gaussianBlurSep3D

        public static org.jocl.cl_mem gaussianBlurSep3D​(org.jocl.cl_context cl,
                                                        org.jocl.cl_device_id device,
                                                        org.jocl.cl_mem inputBuffer,
                                                        int time,
                                                        int elementCount,
                                                        float[] sigmas,
                                                        int width,
                                                        int height,
                                                        int depth,
                                                        int color,
                                                        int[] colorMask)
      • gaussianBlur4D

        private void gaussianBlur4D()
        Calls gaussianBlur3D for each volume in the time series image.