Class OpenCLAlgorithmVolumeNormals
- 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.OpenCLAlgorithmVolumeNormals
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class OpenCLAlgorithmVolumeNormals extends OpenCLAlgorithmBase
OpenCL Algorithm implementation calculate the volume normals of a 3D image. Two methods for the normal calculation are provided. One reads the ModelImage data and creates OpenCL Buffers for the data. The other method reads the volume data from a shared OpenGL Texture
-
-
Field Summary
Fields Modifier and Type Field Description private WildMagic.LibRenderers.OpenGLRenderer.TextureID
m_kTextureID
OpenGL Texture ID containing the volume data.-
Fields inherited from class gov.nih.mipav.model.algorithms.OpenCLAlgorithmBase
cl, color, colorMask, 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 OpenCLAlgorithmVolumeNormals(ModelImage srcImg, long type)
Create an OpenCL Algorithm for calculating the volume normals.OpenCLAlgorithmVolumeNormals(ModelImage srcImg, com.jogamp.opengl.GL3bc gl, WildMagic.LibRenderers.OpenGLRenderer.TextureID textureID)
Create an OpenCL Algorithm for calculating the volume normals.OpenCLAlgorithmVolumeNormals(ModelImage srcImg, ModelImage destImg, long type)
Create an OpenCL Algorithm for calculating the volume normals.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcNormals()
Calculates the volume normals from the input source ModelImage.private void
calcNormalsShared()
Calculates the volume normals shared OpenGL texture.private void
calcNormalsSlices()
Calculates the volume normals from the input source ModelImage.void
finalize()
Prepare this class for destruction.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
-
-
-
-
Constructor Detail
-
OpenCLAlgorithmVolumeNormals
public OpenCLAlgorithmVolumeNormals(ModelImage srcImg, long type)
Create an OpenCL Algorithm for calculating the volume normals. Does not use OpenGL Shared texture.- Parameters:
srcImg
- source imagetype
- OpenCL Platform type, may be CL.CL_DEVICE_TYPE_GPU to specify the GPU or CL.CL_DEVICE_TYPE_CPU to specify the CPU.
-
OpenCLAlgorithmVolumeNormals
public OpenCLAlgorithmVolumeNormals(ModelImage srcImg, ModelImage destImg, long type)
Create an OpenCL Algorithm for calculating the volume normals. Does not use OpenGL Shared texture.- Parameters:
srcImg
- source imagetype
- OpenCL Platform type, may be CL.CL_DEVICE_TYPE_GPU to specify the GPU or CL.CL_DEVICE_TYPE_CPU to specify the CPU.
-
OpenCLAlgorithmVolumeNormals
public OpenCLAlgorithmVolumeNormals(ModelImage srcImg, com.jogamp.opengl.GL3bc gl, WildMagic.LibRenderers.OpenGLRenderer.TextureID textureID)
Create an OpenCL Algorithm for calculating the volume normals. Uses OpenGL Shared texture.- Parameters:
srcImg
- source imagegl
- OpenGL context, must be currenttextureID
- OpenCL texture ID
-
-
Method Detail
-
finalize
public void finalize()
Prepare this class for destruction.- Overrides:
finalize
in classOpenCLAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcNormals
private void calcNormals()
Calculates the volume normals from the input source ModelImage. Creates the kernels, command queue, and OpenCL buffers. Execute the kernels on the command queue and saves the result into a new ModelImage.
-
calcNormalsSlices
private void calcNormalsSlices()
Calculates the volume normals from the input source ModelImage. Creates the kernels, command queue, and OpenCL buffers. Execute the kernels on the command queue and saves the result into a new ModelImage.
-
calcNormalsShared
private void calcNormalsShared()
Calculates the volume normals shared OpenGL texture. Creates the kernels, command queue, and OpenCL buffers. Execute the kernels on the command queue and saves the result into a new ModelImage.
-
-