Class AlgorithmRotate
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.AlgorithmRotate
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmRotate extends AlgorithmBase
An Algorithm to rotate 3D or 4D dataset 90 or 180 degrees about X, Y, or Z axis. 2D Images can also be rotated. A new rotated image with modified dimensions and resolutions created and can be accessed through returnImage().- Version:
- 1.0 July 25, 2000
- Author:
- Harman J. Singh, Matthew J. McAuliffe, Ph.D.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean[]
axisFlip
private int[]
axisOrder
(package private) ViewJProgressBar
progressBar
private boolean
quiet
static int
X_AXIS_180
Rotate about the x axis 180 degrees.static int
X_AXIS_MINUS
Rotate about the x axis -90 degrees (or 270 degrees).static int
X_AXIS_PLUS
Rotate about the x axis 90 degrees.static int
Y_AXIS_180
Rotate about the y axis 180 degrees.static int
Y_AXIS_MINUS
Rotate about the y axis -90 degrees (or 270 degrees).static int
Y_AXIS_PLUS
Rotate about the y axis 90 degrees.static int
Z_AXIS_180
Rotate about the z axis 180 degrees.static int
Z_AXIS_MINUS
Rotate about the z axis -90 degrees (or 270 degrees).static int
Z_AXIS_PLUS
Rotate about the z axis 90 degrees.-
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 AlgorithmRotate(ModelImage srcImg, int rotateMode)
Creates new algorithm for rotating.AlgorithmRotate(ModelImage srcImg, int[] order, boolean[] flip)
Creates new algorithm for rotating.AlgorithmRotate(ModelImage srcImg, int rotateMode, int progress)
Creates new algorithm for rotating.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
calcInPlace()
Calculates the rotated image and replaces the source image with the rotated image.void
finalize()
Prepares this class for destruction.private void
init(int rotateAxis)
ModelImage
returnImage()
Returns the rotated image.void
runAlgorithm()
Runs the rotation algorithm.void
setQuiet(boolean quiet)
-
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
-
X_AXIS_180
public static final int X_AXIS_180
Rotate about the x axis 180 degrees.- See Also:
- Constant Field Values
-
X_AXIS_PLUS
public static final int X_AXIS_PLUS
Rotate about the x axis 90 degrees.- See Also:
- Constant Field Values
-
X_AXIS_MINUS
public static final int X_AXIS_MINUS
Rotate about the x axis -90 degrees (or 270 degrees).- See Also:
- Constant Field Values
-
Y_AXIS_180
public static final int Y_AXIS_180
Rotate about the y axis 180 degrees.- See Also:
- Constant Field Values
-
Y_AXIS_PLUS
public static final int Y_AXIS_PLUS
Rotate about the y axis 90 degrees.- See Also:
- Constant Field Values
-
Y_AXIS_MINUS
public static final int Y_AXIS_MINUS
Rotate about the y axis -90 degrees (or 270 degrees).- See Also:
- Constant Field Values
-
Z_AXIS_180
public static final int Z_AXIS_180
Rotate about the z axis 180 degrees.- See Also:
- Constant Field Values
-
Z_AXIS_PLUS
public static final int Z_AXIS_PLUS
Rotate about the z axis 90 degrees.- See Also:
- Constant Field Values
-
Z_AXIS_MINUS
public static final int Z_AXIS_MINUS
Rotate about the z axis -90 degrees (or 270 degrees).- See Also:
- Constant Field Values
-
axisOrder
private int[] axisOrder
-
axisFlip
private boolean[] axisFlip
-
progressBar
ViewJProgressBar progressBar
-
quiet
private boolean quiet
-
-
Constructor Detail
-
AlgorithmRotate
public AlgorithmRotate(ModelImage srcImg, int[] order, boolean[] flip)
Creates new algorithm for rotating. Sets the source image and axis parameter.- Parameters:
srcImg
- Source image model.rotateMode
- Rotate about which axis.
-
AlgorithmRotate
public AlgorithmRotate(ModelImage srcImg, int rotateMode)
Creates new algorithm for rotating. Sets the source image and axis parameter.- Parameters:
srcImg
- Source image model.rotateMode
- Rotate about which axis.
-
AlgorithmRotate
public AlgorithmRotate(ModelImage srcImg, int rotateMode, int progress)
Creates new algorithm for rotating. Sets the source image and axis parameter.- Parameters:
srcImg
- Source image model.rotateMode
- Rotate about which axis.progress
- Progress mode (see AlgorithmBase).
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
setQuiet
public void setQuiet(boolean quiet)
- Parameters:
quiet
-
-
returnImage
public ModelImage returnImage()
Returns the rotated image.- Returns:
- The rotated image.
-
runAlgorithm
public void runAlgorithm()
Runs the rotation algorithm. The algorithm is run in place so automatically replaces the source model image. Resets image orientation, axis orientations, and start locations.- Specified by:
runAlgorithm
in classAlgorithmBase
-
init
private void init(int rotateAxis)
-
calcInPlace
private void calcInPlace()
Calculates the rotated image and replaces the source image with the rotated image.
-
-