Package gov.nih.mipav.model.algorithms
Class AlgorithmGenerateIsolines
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmGenerateIsolines
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmGenerateIsolines extends AlgorithmBase
-
-
Field Summary
Fields Modifier and Type Field Description private intBLACKprivate intCASE0private intCASE1private intCASE10private intCASE11private intCASE12private intCASE13private intCASE14private intCASE15private intCASE2private intCASE3private intCASE4private intCASE5private intCASE6private intCASE7private intCASE8private intCASE9private int[]cdprivate int[]clprivate int[]coprivate double[]cuprivate double[]cu2private double[]cxprivate double[]cyprivate double[]inprivate floatintensityBprivate floatintensityGprivate floatintensityRprivate double[]maxxprivate double[]maxyprivate double[]minxprivate double[]minyprivate intnprivate intnumContoursprivate float[][]outprivate intsliceSizeprivate doubleSTEP_SIZEprivate doublethresholdThis is a fast implementation of the marching squares algorithm for finding isolines (lines of equal color) in an image.private double[]tipsprivate double[]vxprivate double[]vyprivate intWHITEprivate intxDimprivate intyDim-
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 AlgorithmGenerateIsolines(ModelImage destImg, ModelImage srcImg, double threshold, float intensityR, float intensityG, float intensityB)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeBoundingBoxes()private voidcreateOnePixelBorder(double borderval)voiddrawContour(int contour)voiddrawContours()private intfindIsolines()intgetContourLength(int contour)doublegetContourX(int contour, int v)doublegetContourY(int contour, int v)intgetNumContours()intixy(int x, int y)private voidpreCodeImage()voidrunAlgorithm()Actually runs the algorithm.doublet(double A, double B)intwrap(int i, int lo, int hi)-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, 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
-
threshold
private double threshold
This is a fast implementation of the marching squares algorithm for finding isolines (lines of equal color) in an image.
-
intensityR
private float intensityR
-
intensityG
private float intensityG
-
intensityB
private float intensityB
-
in
private double[] in
-
out
private float[][] out
-
vx
private double[] vx
-
vy
private double[] vy
-
minx
private double[] minx
-
miny
private double[] miny
-
maxx
private double[] maxx
-
maxy
private double[] maxy
-
cd
private int[] cd
-
cx
private double[] cx
-
cy
private double[] cy
-
cu
private double[] cu
-
cl
private int[] cl
-
co
private int[] co
-
cu2
private double[] cu2
-
tips
private double[] tips
-
n
private int n
-
xDim
private int xDim
-
yDim
private int yDim
-
sliceSize
private int sliceSize
-
STEP_SIZE
private double STEP_SIZE
-
numContours
private int numContours
-
CASE0
private final int CASE0
- See Also:
- Constant Field Values
-
CASE1
private final int CASE1
- See Also:
- Constant Field Values
-
CASE2
private final int CASE2
- See Also:
- Constant Field Values
-
CASE3
private final int CASE3
- See Also:
- Constant Field Values
-
CASE4
private final int CASE4
- See Also:
- Constant Field Values
-
CASE5
private final int CASE5
- See Also:
- Constant Field Values
-
CASE6
private final int CASE6
- See Also:
- Constant Field Values
-
CASE7
private final int CASE7
- See Also:
- Constant Field Values
-
CASE8
private final int CASE8
- See Also:
- Constant Field Values
-
CASE9
private final int CASE9
- See Also:
- Constant Field Values
-
CASE10
private final int CASE10
- See Also:
- Constant Field Values
-
CASE11
private final int CASE11
- See Also:
- Constant Field Values
-
CASE12
private final int CASE12
- See Also:
- Constant Field Values
-
CASE13
private final int CASE13
- See Also:
- Constant Field Values
-
CASE14
private final int CASE14
- See Also:
- Constant Field Values
-
CASE15
private final int CASE15
- See Also:
- Constant Field Values
-
WHITE
private final int WHITE
- See Also:
- Constant Field Values
-
BLACK
private final int BLACK
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AlgorithmGenerateIsolines
public AlgorithmGenerateIsolines(ModelImage destImg, ModelImage srcImg, double threshold, float intensityR, float intensityG, float intensityB)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-
createOnePixelBorder
private void createOnePixelBorder(double borderval)
-
preCodeImage
private void preCodeImage()
-
ixy
public int ixy(int x, int y)
-
findIsolines
private int findIsolines()
-
t
public double t(double A, double B)
-
computeBoundingBoxes
public void computeBoundingBoxes()
-
getContourLength
public int getContourLength(int contour)
-
getNumContours
public int getNumContours()
-
drawContours
public void drawContours()
-
drawContour
public void drawContour(int contour)
-
getContourX
public double getContourX(int contour, int v)
-
getContourY
public double getContourY(int contour, int v)
-
wrap
public int wrap(int i, int lo, int hi)
-
-