Class AlgorithmReplaceRemovedSlices
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.AlgorithmReplaceRemovedSlices
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmReplaceRemovedSlices extends AlgorithmBase
This algorithm is used to insert averaged slices where slices have been removed -If slices were removed at the beginning of the original movie, these slices will not be replaced. - Slices are only inserted between the first and last kept slices- Author:
- Ben Link
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
destFlag
DOCUMENT ME!private float
imageMin
DOCUMENT ME!private boolean
insertBlank
If true, insert a blank rather than a weighted average.private boolean
isDicom
DOCUMENT ME!private boolean
isSplit
DOCUMENT ME!private boolean[]
removedSlices
every false value in the array corresponds to a slice within the movie passed in. true values represent removed slicesprivate ModelImage
resultImage
DOCUMENT ME!-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmReplaceRemovedSlices(ModelImage srcImage, boolean[] removedSlices, boolean isSplit, boolean destFlag, boolean insertBlank)
Constructor for algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disposeLocal()
Local cleanup.void
finalize()
Prepares this class for destruction.ModelImage
getResultImage()
Retrieves the result image.private void
insertAveragedSlices(float[] buffer1, float[] buffer2, int start, int end)
Insert weighted averaged slices between the two indices.private void
insertBlankSlices(float[] buffer1, int start, int end)
Insert blank slices between the two indices.void
runAlgorithm()
Function called by thread to run 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
-
destFlag
private boolean destFlag
DOCUMENT ME!
-
imageMin
private float imageMin
DOCUMENT ME!
-
insertBlank
private boolean insertBlank
If true, insert a blank rather than a weighted average.
-
isDicom
private boolean isDicom
DOCUMENT ME!
-
isSplit
private boolean isSplit
DOCUMENT ME!
-
removedSlices
private boolean[] removedSlices
every false value in the array corresponds to a slice within the movie passed in. true values represent removed slices
-
resultImage
private ModelImage resultImage
DOCUMENT ME!
-
-
Constructor Detail
-
AlgorithmReplaceRemovedSlices
public AlgorithmReplaceRemovedSlices(ModelImage srcImage, boolean[] removedSlices, boolean isSplit, boolean destFlag, boolean insertBlank)
Constructor for algorithm.- Parameters:
srcImage
- the source imageremovedSlices
- an array showing which slices were removedisSplit
- DOCUMENT ME!destFlag
- DOCUMENT ME!insertBlank
- If true, insert a blank rather than a weighted average
-
-
Method Detail
-
disposeLocal
public void disposeLocal()
Local cleanup.
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
getResultImage
public ModelImage getResultImage()
Retrieves the result image.- Returns:
- resultImage the new image
-
runAlgorithm
public void runAlgorithm()
Function called by thread to run the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
insertAveragedSlices
private void insertAveragedSlices(float[] buffer1, float[] buffer2, int start, int end)
Insert weighted averaged slices between the two indices.- Parameters:
buffer1
- empty buffer to hold the first slicebuffer2
- empty buffer to hold the last slicestart
- start indexend
- end index
-
insertBlankSlices
private void insertBlankSlices(float[] buffer1, int start, int end)
Insert blank slices between the two indices.- Parameters:
buffer1
- empty buffer to hold the minimum valuestart
- start indexend
- end index
-
-