Class AlgorithmColorEdge
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmColorEdge
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmColorEdge extends AlgorithmBase
This algorithm uses a hypercomplex filter to find the edges between a region of two user specified colors. This code is based on material in the article: Colour-Sensitive Edge Detection using Hypercomplex Filters by Carolyn J. Evans and Stephen J. Sangwine. This filter operates in 2D. Since the 2 colors are normalized to unit vectors, the filter only responds to the color or chromaticity information and ignores the luminance information. In this case hypercomplex filters is really just a fancy way of saying that dot products and cross products of colors are used. FLAG_T24.tif is an excellent test file for this algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description private double
blue1
private double
blue2
private double
green1
private double
green2
private double
red1
private double
red2
-
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 AlgorithmColorEdge(ModelImage dest, ModelImage src, int red1int, int green1int, int blue1int, int red2int, int green2int, int blue2int)
This constructor initialises a Color Edge algorithm for a source and destination image, and ensures that the destination image isModelStorageBase.UBYTE
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcInPlace()
Filters the source image.private void
calcStoreInDest()
This function produces a color edged image into a ModelImage that does not replace the original image-data.void
finalize()
Prepares this class for destruction.void
runAlgorithm()
Standard algorithm run method.-
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
-
AlgorithmColorEdge
public AlgorithmColorEdge(ModelImage dest, ModelImage src, int red1int, int green1int, int blue1int, int red2int, int green2int, int blue2int)
This constructor initialises a Color Edge algorithm for a source and destination image, and ensures that the destination image isModelStorageBase.UBYTE
.Currently (9 May 2006), this algorithm does not support replacing the original data set with that of the color edge image.
- Parameters:
dest
- DOCUMENT ME!src
- DOCUMENT ME!red1
-green1
-blue1
-red2
-green2
-blue2
-
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Standard algorithm run method. It will not run if the source Image isnull
. The calculation is done and placed in a separate destination image if it is to be stored there.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcInPlace
private void calcInPlace()
Filters the source image. Replaces the original image with the filtered image.Does not currently work.
-
calcStoreInDest
private void calcStoreInDest()
This function produces a color edged image into a ModelImage that does not replace the original image-data.
-
-