Class AlgorithmInsertSlice
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmInsertSlice
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
Algorithm to insert a slice. Operates with sliceType either AVERAGE or BLANK or ORGIINAL. If AVERAGE, the inserted
slice is set equal to the mean of the 2 surrounding slices unless it is an new start or end. A new start or end
simply preserves the usual slice spacing. In BLANK mode a slice with all pixels zero is inserted. In original a 2D
image of the same dimensions is inserted. Must insert black and white with black and white and color with color.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCopy adjacent slice.static final intCopy adjacent slice.static final intAverage slice type - the inserted slice is set equal to the mean of the 2 surrounding slices.static final intBlank slice type - the inserted slice is blank.private ModelImageImage inserted for slice type == ORIGINAL.private intNumber of slice before which another slice is inserted.private intOriginal Z dimension of the image.static final intOriginal slice type - a 2D image is inserted.private intArea of a slice (Xdim * Ydim).private intInsert an AVERAGE or BLANK image slice.static final intWeighted average slice type.private floatFor weighted averaging.private intX dimension of the image.private intY dimension of the image.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
ConstructorsConstructorDescriptionAlgorithmInsertSlice(ModelImage srcImage, ModelImage destImage, int insertSlice, int sliceType, ModelImage insertedImage) Import source and destination images into the class. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Prepares this class for destruction.voidRuns algorithm.voidsetWeightPrevious(float wp) DOCUMENT ME!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
-
WEIGHTED_AVERAGE
public static final int WEIGHTED_AVERAGEWeighted average slice type.- See Also:
-
AVERAGE
public static final int AVERAGEAverage slice type - the inserted slice is set equal to the mean of the 2 surrounding slices.- See Also:
-
BLANK
public static final int BLANKBlank slice type - the inserted slice is blank.- See Also:
-
ORIGINAL
public static final int ORIGINALOriginal slice type - a 2D image is inserted.- See Also:
-
ADJACENT_DOWN
public static final int ADJACENT_DOWNCopy adjacent slice.- See Also:
-
ADJACENT_UP
public static final int ADJACENT_UPCopy adjacent slice.- See Also:
-
insertedImage
Image inserted for slice type == ORIGINAL. -
insertSlice
private int insertSliceNumber of slice before which another slice is inserted. -
oldZdim
private int oldZdimOriginal Z dimension of the image. -
sliceArea
private int sliceAreaArea of a slice (Xdim * Ydim). -
sliceType
private int sliceTypeInsert an AVERAGE or BLANK image slice. -
weightPrevious
private float weightPreviousFor weighted averaging. -
Xdim
private int XdimX dimension of the image. -
Ydim
private int YdimY dimension of the image.
-
-
Constructor Details
-
AlgorithmInsertSlice
public AlgorithmInsertSlice(ModelImage srcImage, ModelImage destImage, int insertSlice, int sliceType, ModelImage insertedImage) Import source and destination images into the class.- Parameters:
srcImage- source image (image to clip from)destImage- destination image (image to paste to)insertSlice- number of slice before which another slice is insertedsliceType- AVERAGE or BLANK or ORIGINALinsertedImage- image inserted for sliceType == ORIGINAL
-
-
Method Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()Runs algorithm.- Specified by:
runAlgorithmin classAlgorithmBase
-
setWeightPrevious
public void setWeightPrevious(float wp) DOCUMENT ME!- Parameters:
wp- DOCUMENT ME!
-