Class OpenCLAlgorithmGaussianBlur
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.OpenCLAlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.OpenCL.filters.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 Summary
Fields Modifier and Type Field Description private int[]
colorMask
Color flags.private float[]
GaussData_2D
Storage location of the 2D Gaussian kernel.private float[]
GaussData_3D
private int[]
kExtents_2D
Extents of the 2D kernel.private int[]
kExtents_3D
Extents of the 3D kernel.private int[]
kOrigins_2D
Origins of the 2D kernel.private int[]
kOrigins_3D
Origins of the 3D kernel.private float[]
sigmas
Standard deviations of the Gaussian used to calculate the kernels.-
Fields inherited from class gov.nih.mipav.model.algorithms.OpenCLAlgorithmBase
cl, color, contextLibrary, depth, device, entireImage, height, m_iDeviceType, m_kGL, openCLTypeLibrary, time, width
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description OpenCLAlgorithmGaussianBlur(ModelImage srcImg, float[] sigmas, boolean maskFlag, boolean separable, boolean img25D)
Creates a new AlgorithmGaussianBlur object.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.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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for destruction.private void
gaussianBlur25D()
2D Implementation: Create the OpenCL Buffers, Kernel, and CommandQueue.private void
gaussianBlur3D(int time)
3D Implementation: Create the OpenCL Buffers, Kernel, and CommandQueue.private void
gaussianBlur4D()
Calls gaussianBlur3D for each volume in the time series image.private void
gaussianBlurSep25D()
private void
gaussianBlurSep25DSlices()
private void
gaussianBlurSep3D(int time)
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)
private void
makeKernels2D()
Creates 2D Gaussian kernels for the blurring process.private void
makeKernels3D()
Creates 3D Gaussian kernels for the blurring process.void
runAlgorithm()
Starts the program.-
Methods inherited from class gov.nih.mipav.model.algorithms.OpenCLAlgorithmBase
checkError, getInt, getInts, getLong, getLongs, getMaxMemoryUsed, getString, getString, initCL, isOCLAvailable, readKernelFile, roundUp, saveImage, saveImage, setBlue, setGreen, setRed, setTime
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
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 imagesigmas
- the standard deviations of the GaussianmaskFlag
- VOI Maskingimg25D
- 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 imagesrcImg
- the source imagesigmas
- the sigmasmaskFlag
- the mask flagimg25D
- 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 imagesrcImg
- the source imagesigmas
- the sigmasmaskFlag
- the mask flagimg25D
- the 2.5D indicator
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classOpenCLAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
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.
-
-