Class AlgorithmFuzzyMinimization
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmFuzzyMinimization
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmFuzzyMinimization extends AlgorithmBase
This algorithm performs minimization of fuzziness, a reduction of the amount of fuzziness. This method is probably the first fuzzy approach to image enhancement and is also known in the literature as contrast intensification operator. The main idea is to reduce the amount of image fuzziness. The algorithm is as follows: 1.) Gray-level fuzzification (u(g) denotes the degree of brightness) u(g) = pow(1 + (gmax - g)/Fd, -Fe) where Fd and Fe are the exponential and denominational fuzzifiers that control the amount of grayness ambiguity in the membership plane. Suitable values for Fe are 1 and 2. Fd is computed from a user selected crossover gray scale value, gc, at which u(gc) = 0.5. gmax is the maximum gray level in the new image. gmax >= srcMax. alpha = pow(1 + (gmax - gmin)/Fd, -Fe) gmin-
-
Field Summary
Fields Modifier and Type Field Description private double
crossVal
The crossover gray scale value at which u(crossVal) = 0.5private boolean
entireImage
true means apply to entire image, false only region.private double
expFuzzifier
Exponential fuzzifier between 1.0 and 2.0private double
gmax
The new maximum level gmax >= srcMaxprivate double
gmin
The new minimum level gminprivate int
iterations
number of times to filter the image.private java.util.BitSet
mask
contains VOI.-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmFuzzyMinimization(ModelImage srcImg, int iters, double crossVal, double expFuzzifier, double gmin, double gmax, boolean maskFlag)
Constructor for images in which changes are returned to the source image.AlgorithmFuzzyMinimization(ModelImage destImg, ModelImage srcImg, int iters, double crossVal, double expFuzzifier, double gmin, double gmax, boolean maskFlag)
Constructor for images in which changes are placed in a predetermined destination image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcStoreInDest()
This function produces a new image that has had fuzzy minimization filteringprivate void
calcStoreInPlace()
Fuzzy minimization filtering of the source image.void
finalize()
Prepares this class for destruction.void
runAlgorithm()
Starts the algorithm.-
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
-
-
-
-
Field Detail
-
entireImage
private boolean entireImage
true means apply to entire image, false only region.
-
iterations
private int iterations
number of times to filter the image.
-
crossVal
private double crossVal
The crossover gray scale value at which u(crossVal) = 0.5
-
expFuzzifier
private double expFuzzifier
Exponential fuzzifier between 1.0 and 2.0
-
gmin
private double gmin
The new minimum level gmin-
gmax
private double gmax
The new maximum level gmax >= srcMax
-
mask
private java.util.BitSet mask
contains VOI.
-
Constructor Detail
-
AlgorithmFuzzyMinimization
public AlgorithmFuzzyMinimization(ModelImage srcImg, int iters, double crossVal, double expFuzzifier, double gmin, double gmax, boolean maskFlag)
Constructor for images in which changes are returned to the source image.- Parameters:
srcImg
- Source image model.iters
- Number of iterations of the fuzzy minimization filter.crossVal
- crossover gray scale value at which u(crossVal) = 0.5expFuzzifier
- exponential fuzzifier between 1.0 and 2.0gmin
- The new minimum level gmingmax
- The new maximum level gmax >= srcMaxmaskFlag
- Flag that indicates that the fuzzy minimization filtering will be performed for the whole image if equal to true.
-
AlgorithmFuzzyMinimization
public AlgorithmFuzzyMinimization(ModelImage destImg, ModelImage srcImg, int iters, double crossVal, double expFuzzifier, double gmin, double gmax, boolean maskFlag)
Constructor for images in which changes are placed in a predetermined destination image.- Parameters:
destImg
- Image model where result image is stored.srcImg
- Source image model.iters
- Number of iterations of the fuzzy minimization filter.crossVal
- crossover gray scale value at which u(crossVal) = 0.5expFuzzifier
- exponential fuzzifier between 1.0 and 2.0gmin
- The new minimum level gmingmax
- The new maximum level gmax >= srcMaxmaskFlag
- Flag that indicates that the fuzzy minimization filtering will be performed for the whole image if equal to true.
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Starts the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcStoreInPlace
private void calcStoreInPlace()
Fuzzy minimization filtering of the source image. Replaces the original image with the filtered image.
-
calcStoreInDest
private void calcStoreInDest()
This function produces a new image that has had fuzzy minimization filtering
-
-
-
-