Class AlgorithmMarkovSmooth
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmMarkovSmooth
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmMarkovSmooth extends AlgorithmBase
- Author:
- ilb This is a port of the MATLAB program restore_image.m written by PeterOrchard to Java. This port is performed with the permission of Peter Orchard. The original Markov Random Field Optimisation text with accompanying code is found at http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/AV0809/ORCHARD/. The code uses a technique invented specifically for Markov Random Field optimization called Iterated Conditional Modes (ICM). This code is used to smooth an image. This restoration method does a good job of smoothing the noise from surfaces of constant or slowly-varying intensity. It does not do so well with thin, sharp features. This is due to the energy function punishing local differences in pixel values.
-
-
Field Summary
Fields Modifier and Type Field Description private double
covariance
The known covariance of the Gaussian noiseprivate int
iterations
The number of iterations to performprivate double
max_diff
The maximum contribution to the potential of the difference between two neighboring pixel values.private double
weight_diff
The weighting attached to the component of the potential due to the difference between two neighboring pixel values.-
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 AlgorithmMarkovSmooth(ModelImage srcImg, double covariance, double max_diff, double weight_diff, int iterations)
AlgorithmMarkovSmooth(ModelImage destImg, ModelImage srcImg, double covariance, double max_diff, double weight_diff, int iterations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
runAlgorithm()
Actually runs the algorithm.-
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
-
covariance
private double covariance
The known covariance of the Gaussian noise
-
max_diff
private double max_diff
The maximum contribution to the potential of the difference between two neighboring pixel values.
-
weight_diff
private double weight_diff
The weighting attached to the component of the potential due to the difference between two neighboring pixel values.
-
iterations
private int iterations
The number of iterations to perform
-
-
Constructor Detail
-
AlgorithmMarkovSmooth
public AlgorithmMarkovSmooth(ModelImage srcImg, double covariance, double max_diff, double weight_diff, int iterations)
- Parameters:
srcImg
-covariance
-max_diff
-weight_diff
-iterations
-
-
AlgorithmMarkovSmooth
public AlgorithmMarkovSmooth(ModelImage destImg, ModelImage srcImg, double covariance, double max_diff, double weight_diff, int iterations)
- Parameters:
destImg
-srcImg
-covariance
-max_diff
-weight_diff
-iterations
-
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
-