Class 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 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
      • 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 class AlgorithmBase
      • 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 class AlgorithmBase
      • init

        private void init​(int rotateAxis)
      • calcInPlace

        private void calcInPlace()
        Calculates the rotated image and replaces the source image with the rotated image.