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:
ActionListener,WindowListener,Runnable,EventListener
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate final intprivate int[]private int[]private int[]private double[]private double[]private double[]private double[]private double[]private floatprivate floatprivate floatprivate double[]private double[]private double[]private double[]private intprivate intprivate float[][]private intprivate doubleprivate doubleThis is a fast implementation of the marching squares algorithm for finding isolines (lines of equal color) in an image.private double[]private double[]private double[]private final intprivate intprivate intFields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmGenerateIsolines(ModelImage destImg, ModelImage srcImg, double threshold, float intensityR, float intensityG, float intensityB) -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate voidcreateOnePixelBorder(double borderval) voiddrawContour(int contour) voidprivate intintgetContourLength(int contour) doublegetContourX(int contour, int v) doublegetContourY(int contour, int v) intintixy(int x, int y) private voidvoidActually 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
threshold
private double thresholdThis 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:
-
CASE1
private final int CASE1- See Also:
-
CASE2
private final int CASE2- See Also:
-
CASE3
private final int CASE3- See Also:
-
CASE4
private final int CASE4- See Also:
-
CASE5
private final int CASE5- See Also:
-
CASE6
private final int CASE6- See Also:
-
CASE7
private final int CASE7- See Also:
-
CASE8
private final int CASE8- See Also:
-
CASE9
private final int CASE9- See Also:
-
CASE10
private final int CASE10- See Also:
-
CASE11
private final int CASE11- See Also:
-
CASE12
private final int CASE12- See Also:
-
CASE13
private final int CASE13- See Also:
-
CASE14
private final int CASE14- See Also:
-
CASE15
private final int CASE15- See Also:
-
WHITE
private final int WHITE- See Also:
-
BLACK
private final int BLACK- See Also:
-
-
Constructor Details
-
AlgorithmGenerateIsolines
public AlgorithmGenerateIsolines(ModelImage destImg, ModelImage srcImg, double threshold, float intensityR, float intensityG, float intensityB)
-
-
Method Details
-
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)
-