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 int
BLACK
private int
CASE0
private int
CASE1
private int
CASE10
private int
CASE11
private int
CASE12
private int
CASE13
private int
CASE14
private int
CASE15
private int
CASE2
private int
CASE3
private int
CASE4
private int
CASE5
private int
CASE6
private int
CASE7
private int
CASE8
private int
CASE9
private int[]
cd
private int[]
cl
private int[]
co
private double[]
cu
private double[]
cu2
private double[]
cx
private double[]
cy
private double[]
in
private float
intensityB
private float
intensityG
private float
intensityR
private double[]
maxx
private double[]
maxy
private double[]
minx
private double[]
miny
private int
n
private int
numContours
private float[][]
out
private int
sliceSize
private double
STEP_SIZE
private double
threshold
This is a fast implementation of the marching squares algorithm for finding isolines (lines of equal color) in an image.private double[]
tips
private double[]
vx
private double[]
vy
private int
WHITE
private int
xDim
private int
yDim
-
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 void
computeBoundingBoxes()
private void
createOnePixelBorder(double borderval)
void
drawContour(int contour)
void
drawContours()
private int
findIsolines()
int
getContourLength(int contour)
double
getContourX(int contour, int v)
double
getContourY(int contour, int v)
int
getNumContours()
int
ixy(int x, int y)
private void
preCodeImage()
void
runAlgorithm()
Actually runs the algorithm.double
t(double A, double B)
int
wrap(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:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in 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)
-
-