Class CUDASeparableConvolutionFunctions

java.lang.Object
net.preibisch.mvrecon.process.cuda.CUDASeparableConvolutionFunctions

public class CUDASeparableConvolutionFunctions extends Object
Executes gaussian convolution using the native CUDA implementation (https://github.com/StephanPreibisch/SeparableConvolutionCUDALib)
Author:
Stephan Preibisch (stephan.preibisch@gmx.de)
  • Constructor Details

    • CUDASeparableConvolutionFunctions

      public CUDASeparableConvolutionFunctions(CUDASeparableConvolution cuda, int cudaDeviceId)
  • Method Details

    • gauss

      public boolean gauss(float[] img, int[] dim, double sigma)
      Compute Gaussian convolution with and extend-border-pixels outofbounds strategy
      Parameters:
      img - - the image (1d/2d/3d) as flat float array
      dim - - the dimensions of the image in 1d/2d/3d
      sigma - - the sigma for all dimensions
      Returns:
      success? true or false
    • gauss

      public boolean gauss(float[] img, int[] dim, double[] sigma)
      Compute Gaussian convolution with and extend-border-pixels outofbounds strategy
      Parameters:
      img - - the image (1d/2d/3d) as flat float array
      dim - - the dimensions of the image in 1d/2d/3d
      sigma - - the sigma per dimension
      Returns:
      success? true or false
    • gauss

      public boolean gauss(float[] img, int[] dim, float[] sigma)
    • gauss

      public boolean gauss(float[] img, int[] dim, double sigma, CUDASeparableConvolutionFunctions.OutOfBounds oobs, float oobsValue)
      Compute Gaussian convolution
      Parameters:
      img - - the image (1d/2d/3d) as flat float array
      dim - - the dimensions of the image in 1d/2d/3d
      sigma - - the sigma for all dimensions
      oobs - - the OutOfBounds strategy
      oobsValue - - value to use in oobs
      Returns:
      success? true or false
    • gauss

      public boolean gauss(float[] img, int[] dim, double[] sigma, CUDASeparableConvolutionFunctions.OutOfBounds oobs, float oobsValue)
      Compute Gaussian convolution
      Parameters:
      img - - the image (1d/2d/3d) as flat float array
      dim - - the dimensions of the image in 1d/2d/3d
      sigma - - the sigma per dimension
      oobs - - the OutOfBounds strategy
      oobsValue - - the value for out of image pixels if the OutOfBoundsStrategy is OutOfBounds.VALUE
      Returns:
      success? true or false
    • gauss

      public static final boolean gauss(float[] img, int[] dim, double sigma, CUDASeparableConvolutionFunctions.OutOfBounds oobs, float oobsValue, CUDASeparableConvolution cuda, int cudaDeviceId)
      Compute Gaussian convolution
      Parameters:
      img - - the image (1d/2d/3d) as flat float array
      dim - - the dimensions of the image in 1d/2d/3d
      sigma - - the sigma for all dimensions
      oobs - - the OutOfBounds strategy
      oobsValue - - the value for out of image pixels if the OutOfBoundsStrategy is OutOfBounds.VALUE
      cuda - - The CUDASeparableConvolution interface that loaded the external native library
      cudaDeviceId - - which CUDA device to use, -1 means single-threaded computation on CPU using native code
      Returns:
      success? true or false
    • gauss

      public static final boolean gauss(float[] img, int[] dim, double[] sigma, CUDASeparableConvolutionFunctions.OutOfBounds oobs, float oobsValue, CUDASeparableConvolution cuda, int cudaDeviceId)
      Compute Gaussian convolution
      Parameters:
      img - - the image (1d/2d/3d) as flat float array
      dim - - the dimensions of the image in 1d/2d/3d
      sigma - - the sigma per dimension
      oobs - - the OutOfBounds strategy
      oobsValue - - the value for out of image pixels if the OutOfBoundsStrategy is OutOfBounds.VALUE
      cuda - - The CUDASeparableConvolution interface that loaded the external native library
      cudaDeviceId - - which CUDA device to use, -1 means single-threaded computation on CPU using native code
      Returns:
      success? true or false
    • getCUDAKernels

      public static float[][] getCUDAKernels(double[] sigma, int[] supportedKernelSizes)
    • getFloatKernelPadded

      public static float[] getFloatKernelPadded(double[] kernel, int size)