Class AlgorithmFlip

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmFlip
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, 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.
  • Field Details

    • Y_AXIS

      public static final int Y_AXIS
      Flip along Y axis.
      See Also:
    • X_AXIS

      public static final int X_AXIS
      Flip along X axis.
      See Also:
    • Z_AXIS

      public static final int Z_AXIS
      Flip along Z axis.
      See Also:
    • IMAGE_AND_VOI

      public static final int IMAGE_AND_VOI
      Image and all VOIs should be flipped.
      See Also:
    • IMAGE

      public static final int IMAGE
      Denotes image should be flipped without VOI.
      See Also:
    • VOI_TYPE

      public static final int VOI_TYPE
      Denotes selected VOI should be flipped.
      See Also:
    • 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 Details

    • 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 model
      flipMode - flip about which axis
      flipObject - DOCUMENT ME!
      changeOrientationOrigin -
  • Method Details

    • finalize

      public void finalize()
      Prepares this class for destruction.
      Overrides:
      finalize in class AlgorithmBase
    • runAlgorithm

      public void runAlgorithm()
      Runs the flip algorithm.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • 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.