Package gov.nih.mipav.model.algorithms
Class AlgorithmColorSaturation
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmColorSaturation
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmColorSaturation extends AlgorithmBase
This algorithm changes the saturation of a color image while keeping the hue and intensity constant. Intensity = (R + G + B)/3 Hue = theta if B G with theta = arccos{0.5[(R - G) + (R - B)]/sqrt[(R - G)**2 + (R - B)*(G - B)]} Saturation = 1 - 3 * min(R, G, B)/(R + G + B) Derived from quaternion formula: Radial dilation = ((a + 2)/2)*(r*i + g*j + b*k) + (a/2)*u*(ri + g*j + b*k)*u where u is a pure unit quaternion. For radial dilation around the gray line where r = g = b, set u = (i + j + k)/sqrt(3) Radial dilation around gray line = ((a + 2)/2)*(r*i + g*j + b*k) + (a/2)*((i + j + k)/sqrt(3))*(r*i + g*j + b*k)*((i + j + k)/sqrt(3)) which expands space outward for a > 0 or moves it out from the r = g = b line and compresses space for a-
-
Field Summary
Fields Modifier and Type Field Description private float
a
-
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 AlgorithmColorSaturation()
AlgorithmColorSaturation - default constructor.AlgorithmColorSaturation(ModelImage destImg, ModelImage srcImg, float a)
AlgorithmColorSaturation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
finalize -void
runAlgorithm()
Starts the program.-
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
-
AlgorithmColorSaturation
public AlgorithmColorSaturation()
AlgorithmColorSaturation - default constructor.
-
AlgorithmColorSaturation
public AlgorithmColorSaturation(ModelImage destImg, ModelImage srcImg, float a)
AlgorithmColorSaturation.- Parameters:
destImg
- DOCUMENT ME!srcImg
- DOCUMENT ME!a
- Scale factor which increases saturation for a > 0 and decreases saturation for a
-
-
Method Detail
-
finalize
public void finalize()
finalize -- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
-