Class AlgorithmSubtractVOI
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!static final intDOCUMENT ME!private doubleMaximum clipping modes if data result value exceeds the capacity of image's data type.private floatDOCUMENT ME!private doubleMinimum clipping modes if data result value exceeds the capacity of image's data type.private floatDOCUMENT ME!private intClipping mode.private doubleUsed to store the image maximum.static final intDOCUMENT ME!static final intDOCUMENT ME!private doubleUsed to store the image minimum.private doubleDOCUMENT ME!private doubleDOCUMENT ME!private doubleDOCUMENT ME!static final intDOCUMENT ME!Fields 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
ConstructorsConstructorDescriptionAlgorithmSubtractVOI(ModelImage srcImg, int _averageMode, int _clipMode) Creates a new AlgorithmSubtractVOI object.AlgorithmSubtractVOI(ModelImage destImg, ModelImage srcImg, int _averageMode, int _clipMode) Creates a new AlgorithmSubtractVOI object. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidGenerates the new data and places in the source image.private voidGenerates the new data and places in the source image.private voidGenerates the new data and places in a new (destination) image.private voidGenerates the new data and places in a new (destination) image.voidfinalize()Prepares this class for destruction.private intfindType(int stType) Find the type able to contain the full range of the data.private voidDOCUMENT ME!private intpromoteType(int presentType) DOCUMENT ME!voidStarts the program.private voidSets clipMin and clipMax.private booleantestType(int type, double minVal, double maxVal) Determine if the min and max values are in the image types range.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
-
MEAN
public static final int MEANDOCUMENT ME!- See Also:
-
MEDIAN
public static final int MEDIANDOCUMENT ME!- See Also:
-
CLIP
public static final int CLIPDOCUMENT ME!- See Also:
-
PROMOTE
public static final int PROMOTEDOCUMENT ME!- See Also:
-
average
private double averageDOCUMENT ME! -
averageB
private float averageBDOCUMENT ME! -
averageG
private float averageGDOCUMENT ME! -
averageMode
private int averageModeDOCUMENT ME! -
averageR
private float averageRDOCUMENT ME! -
clipMax
private double clipMaxMaximum clipping modes if data result value exceeds the capacity of image's data type. -
clipMaxC
private float clipMaxCDOCUMENT ME! -
clipMin
private double clipMinMinimum clipping modes if data result value exceeds the capacity of image's data type. -
clipMinC
private float clipMinCDOCUMENT ME! -
clipMode
private int clipModeClipping mode.CLIP = 0; clamp result data to the bounds of the input image type PROMOTE = 1; promote image type so that the range of the result fits into the new image type. ( ie. byte to short). -
max
private double maxUsed to store the image maximum. -
min
private double minUsed to store the image minimum. -
minR
private double minRDOCUMENT ME! -
minG
private double minGDOCUMENT ME! -
minB
private double minBDOCUMENT ME!
-
-
Constructor Details
-
AlgorithmSubtractVOI
Creates a new AlgorithmSubtractVOI object.- Parameters:
srcImg- source image model_averageMode- mean or median of VOI_clipMode- clamp data to image type range or promote image type to hold new data range.
-
AlgorithmSubtractVOI
Creates a new AlgorithmSubtractVOI object.- Parameters:
destImg- image model where result image is to storedsrcImg- source image model_averageMode- mean or median of VOI_clipMode- clamp data to image type range or promote image type to hold new data range.
-
-
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
-
calcInPlace
private void calcInPlace()Generates the new data and places in the source image.note that if this method is canceled part-way through a multi-sliced image, it will almost certainly be partially adjusted. This is because to save memory buffer-space, it returns an adjusted slice back to the source image after processing it; it then takes out the next slice to alter it. Canceling a job causes the current slice will not be affected, but all previous slices will be.
-
calcInPlaceColor
private void calcInPlaceColor()Generates the new data and places in the source image.note that if this method is canceled part-way through a multi-sliced image, it will almost certainly be partially adjusted. This is because to save memory buffer-space, it returns an adjusted slice back to the source image after processing it; it then takes out the next slice to alter it. Canceling a job causes the current slice will not be affected, but all previous slices will be.
-
calcStoreInDest
private void calcStoreInDest()Generates the new data and places in a new (destination) image.This method checks for thread halting actions more infrequently than the in-place method.
-
calcStoreInDestColor
private void calcStoreInDestColor()Generates the new data and places in a new (destination) image.This method checks for thread halting actions more infrequently than the in-place method.
-
findType
private int findType(int stType) Find the type able to contain the full range of the data.- Parameters:
stType- starting type of image. Image will be promoted above this type if needed.- Returns:
- type capable of storing full range of data. See ModelStorageBase for image types.
-
getAverage
private void getAverage()DOCUMENT ME! -
promoteType
private int promoteType(int presentType) DOCUMENT ME!- Parameters:
presentType- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
setClipValues
private void setClipValues()Sets clipMin and clipMax. -
testType
private boolean testType(int type, double minVal, double maxVal) Determine if the min and max values are in the image types range.- Parameters:
type- image typeminVal- min value of the imagemaxVal- max value of the image- Returns:
- true if min and max are within the image type specified
-