Class OpenCLAlgorithmMarchingCubes
- 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.OpenCLAlgorithmMarchingCubes
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class OpenCLAlgorithmMarchingCubes extends OpenCLAlgorithmBase
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
blurFlag
If true then the input image is blurred slightly.private float
blurSigma
The amount to blur to smooth surface.private boolean
decimateFlag
If true then the extracted surface is decimated into a continuous level of detail surface (clod).private int[]
edgeTable
private float
isoValue
(package private) int[]
numVertsTable
private WildMagic.LibGraphics.SceneGraph.TriMesh
resultMesh
private java.lang.String
surfaceFileName
Path and name of extracted surface file. ".sur" will be appended if necessary.private int[]
triTable
private static int
X
-
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 OpenCLAlgorithmMarchingCubes(ModelImage image, int level, boolean entireImage, boolean decFlag, boolean blurFlag, float sigma, java.lang.String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for destruction.WildMagic.LibGraphics.SceneGraph.TriMesh
getMesh()
private void
marchingCubes3D(int time)
private float
reductionKernel(org.jocl.cl_command_queue commandQueue, long elementCount, org.jocl.cl_mem inputBuffer)
void
runAlgorithm()
Starts the program.private void
saveMesh(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> newVertices, int[] aiConnect, boolean flip, java.lang.String kName)
-
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
-
isoValue
private float isoValue
-
blurFlag
private final boolean blurFlag
If true then the input image is blurred slightly.
-
blurSigma
private float blurSigma
The amount to blur to smooth surface.
-
decimateFlag
private final boolean decimateFlag
If true then the extracted surface is decimated into a continuous level of detail surface (clod).
-
surfaceFileName
private java.lang.String surfaceFileName
Path and name of extracted surface file. ".sur" will be appended if necessary.
-
edgeTable
private int[] edgeTable
-
X
private static final int X
- See Also:
- Constant Field Values
-
triTable
private int[] triTable
-
numVertsTable
int[] numVertsTable
-
resultMesh
private WildMagic.LibGraphics.SceneGraph.TriMesh resultMesh
-
-
Constructor Detail
-
OpenCLAlgorithmMarchingCubes
public OpenCLAlgorithmMarchingCubes(ModelImage image, int level, boolean entireImage, boolean decFlag, boolean blurFlag, float sigma, java.lang.String fileName)
-
-
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
-
marchingCubes3D
private void marchingCubes3D(int time)
-
reductionKernel
private float reductionKernel(org.jocl.cl_command_queue commandQueue, long elementCount, org.jocl.cl_mem inputBuffer)
-
getMesh
public WildMagic.LibGraphics.SceneGraph.TriMesh getMesh()
-
saveMesh
private void saveMesh(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> newVertices, int[] aiConnect, boolean flip, java.lang.String kName) throws java.io.IOException
- Throws:
java.io.IOException
-
-