Package gov.nih.mipav.model.algorithms
Class AlgorithmGraphBasedSegmentation
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmGraphBasedSegmentation
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classprivate class(package private) class(package private) classNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate intprivate floatThe C++ source code for the port was downloaded from Pedro F.(package private) ViewUserInterfaceprivate 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
ConstructorsConstructorDescriptionAlgorithmGraphBasedSegmentation(ModelImage destImg, ModelImage srcImg, float sigma, float k, int minSize) Constructs graph based segmentation algorithm. -
Method Summary
Modifier and TypeMethodDescriptionprivate floatdiff(float[] r, float[] g, float[] b, int x1, int y1, int x2, int y2) voidfinalize()Prepares this class for destruction.voidStarts the program.(package private) AlgorithmGraphBasedSegmentation.universesegment_graph(int num_vertices, int num_edges, ArrayList<AlgorithmGraphBasedSegmentation.edge> edges, float k) 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, 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
-
sigma
private float sigmaThe C++ source code for the port was downloaded from Pedro F. Felzenswalb's web page Graph Based Image Segmentation at http://cs.brown.edu/~pff/segment/ This code is ported with the permission of Pedro F. Felzenszwalb Reference: Pedro F. Felzenszwalb and Daniel P. Huttenlocher, International Journal of Computer Vision, 59(2), September, 2004. Port performed by William Gandler. This program takes a color image and produces a segmentation with a random color assigned to each region Typical parameters are: sigma = 0.5, k = 500, minSize = 20. Larger values for k result in larger components in the result. -
k
private float k -
minSize
private int minSize -
xDim
private int xDim -
UI
-
-
Constructor Details
-
AlgorithmGraphBasedSegmentation
public AlgorithmGraphBasedSegmentation(ModelImage destImg, ModelImage srcImg, float sigma, float k, int minSize) Constructs graph based segmentation algorithm.- Parameters:
destImg- Image model where result image is to storedsrcImg- Source image modelsigma- Used to smooth the input image before segmenting itk- Value for the threshold functionminSize- Minimum component size enforced by post-processing
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
segment_graph
AlgorithmGraphBasedSegmentation.universe segment_graph(int num_vertices, int num_edges, ArrayList<AlgorithmGraphBasedSegmentation.edge> edges, float k) -
diff
private float diff(float[] r, float[] g, float[] b, int x1, int y1, int x2, int y2)
-