Class AlgorithmFlip
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.AlgorithmFlip
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmFlip extends AlgorithmBase
Flips 2D, 3D or 4D grays scale or color dataset about X, Y, or Z axis (when applicable) when AlgorithmFlip.IMAGE is passed to the constructor. An option is given to flip all VOIs at this time. When AlgorithmFlip.VOI is passed, only the selected VOI is flipped about the specified axis.- Version:
- 1.0 July 14, 2000
- Author:
- Matthew J. McAuliffe, Ph.D.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AlgorithmFlip.ShapeHolder
DOCUMENT ME!
-
Field Summary
Fields Modifier and Type Field Description private boolean
changeOrientationOrigin
Whether orientation and origin should change with flipping.private int
flipAxis
Axis to flip along.private int
flipObject
Type of object to flip.static int
IMAGE
Denotes image should be flipped without VOI.static int
IMAGE_AND_VOI
Image and all VOIs should be flipped.static int
VOI_TYPE
Denotes selected VOI should be flipped.static int
X_AXIS
Flip along X axis.static int
Y_AXIS
Flip along Y axis.static int
Z_AXIS
Flip along Z axis.-
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 AlgorithmFlip(ModelImage srcImg, int flipMode, int flipObject, boolean changeOrientationOrigin)
Flips 2D, 3D or 4D grays scale or color dataset about X or Y axis.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcInPlace(int nImages)
Generates the flipped image and replaces the source image with the flippeded image.void
finalize()
Prepares this class for destruction.void
runAlgorithm()
Runs the flip 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
-
Y_AXIS
public static final int Y_AXIS
Flip along Y axis.- See Also:
- Constant Field Values
-
X_AXIS
public static final int X_AXIS
Flip along X axis.- See Also:
- Constant Field Values
-
Z_AXIS
public static final int Z_AXIS
Flip along Z axis.- See Also:
- Constant Field Values
-
IMAGE_AND_VOI
public static final int IMAGE_AND_VOI
Image and all VOIs should be flipped.- See Also:
- Constant Field Values
-
IMAGE
public static final int IMAGE
Denotes image should be flipped without VOI.- See Also:
- Constant Field Values
-
VOI_TYPE
public static final int VOI_TYPE
Denotes selected VOI should be flipped.- See Also:
- Constant Field Values
-
flipAxis
private int flipAxis
Axis to flip along.
-
flipObject
private int flipObject
Type of object to flip.
-
changeOrientationOrigin
private boolean changeOrientationOrigin
Whether orientation and origin should change with flipping.
-
-
Constructor Detail
-
AlgorithmFlip
public AlgorithmFlip(ModelImage srcImg, int flipMode, int flipObject, boolean changeOrientationOrigin)
Flips 2D, 3D or 4D grays scale or color dataset about X or Y axis.- Parameters:
srcImg
- source image modelflipMode
- flip about which axisflipObject
- DOCUMENT ME!changeOrientationOrigin
-
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Runs the flip algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
calcInPlace
private void calcInPlace(int nImages)
Generates the flipped image and replaces the source image with the flippeded image.- Parameters:
nImages
- Number of images to be flipped. If 2D image then nImage = 1, if 3D or 4D image where each image is to processed independently then nImages equals the number of images in the volume.
-
-