Class AlgorithmRotate
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmRotate
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean[]private int[](package private) ViewJProgressBarprivate booleanstatic final intRotate about the x axis 180 degrees.static final intRotate about the x axis -90 degrees (or 270 degrees).static final intRotate about the x axis 90 degrees.static final intRotate about the y axis 180 degrees.static final intRotate about the y axis -90 degrees (or 270 degrees).static final intRotate about the y axis 90 degrees.static final intRotate about the z axis 180 degrees.static final intRotate about the z axis -90 degrees (or 270 degrees).static final intRotate 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, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmRotate(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
Modifier and TypeMethodDescriptionprivate voidCalculates the rotated image and replaces the source image with the rotated image.voidfinalize()Prepares this class for destruction.private voidinit(int rotateAxis) Returns the rotated image.voidRuns the rotation algorithm.voidsetQuiet(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, 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
-
X_AXIS_180
public static final int X_AXIS_180Rotate about the x axis 180 degrees.- See Also:
-
X_AXIS_PLUS
public static final int X_AXIS_PLUSRotate about the x axis 90 degrees.- See Also:
-
X_AXIS_MINUS
public static final int X_AXIS_MINUSRotate about the x axis -90 degrees (or 270 degrees).- See Also:
-
Y_AXIS_180
public static final int Y_AXIS_180Rotate about the y axis 180 degrees.- See Also:
-
Y_AXIS_PLUS
public static final int Y_AXIS_PLUSRotate about the y axis 90 degrees.- See Also:
-
Y_AXIS_MINUS
public static final int Y_AXIS_MINUSRotate about the y axis -90 degrees (or 270 degrees).- See Also:
-
Z_AXIS_180
public static final int Z_AXIS_180Rotate about the z axis 180 degrees.- See Also:
-
Z_AXIS_PLUS
public static final int Z_AXIS_PLUSRotate about the z axis 90 degrees.- See Also:
-
Z_AXIS_MINUS
public static final int Z_AXIS_MINUSRotate about the z axis -90 degrees (or 270 degrees).- See Also:
-
axisOrder
private int[] axisOrder -
axisFlip
private boolean[] axisFlip -
progressBar
ViewJProgressBar progressBar -
quiet
private boolean quiet
-
-
Constructor Details
-
AlgorithmRotate
Creates new algorithm for rotating. Sets the source image and axis parameter.- Parameters:
srcImg- Source image model.rotateMode- Rotate about which axis.
-
AlgorithmRotate
Creates new algorithm for rotating. Sets the source image and axis parameter.- Parameters:
srcImg- Source image model.rotateMode- Rotate about which axis.
-
AlgorithmRotate
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 Details
-
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
setQuiet
public void setQuiet(boolean quiet) - Parameters:
quiet-
-
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:
runAlgorithmin classAlgorithmBase
-
init
private void init(int rotateAxis) -
calcInPlace
private void calcInPlace()Calculates the rotated image and replaces the source image with the rotated image.
-