Class AlgorithmCorrectSpacing

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.utilities.AlgorithmCorrectSpacing
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class AlgorithmCorrectSpacing extends AlgorithmBase
Algorithm to adjust image volume for cases when the slice spacing is not equal to the slice thickness. When spacing > thickness: repeat images from original image set insert blank images (so that in the final image volume, all images will have the same slice thickness and the image volume will be to proper scale. When spacing invalid input: '<' thickness: set thickness = spacing.
  • Field Details

    • DIM

      private int DIM
      The number of dimensions in the image.
    • newZdim

      private int newZdim
      New Z dimension.
    • numBlanks

      private int numBlanks
      Number of blank images, to make up gap.
    • numRepIm

      private int numRepIm
      Number of repeated images, to compensate for gap.
    • oldTimeStepVolume

      private int oldTimeStepVolume
      Volume for each time step.
    • newTimeStepVolume

      private int newTimeStepVolume
      Volume for each time step.
    • oldZdim

      private int oldZdim
      Original Z dimension of the image.
    • resultImage

      private ModelImage resultImage
      Result Image.
    • sliceArea

      private int sliceArea
      Area of a slice (Xdim * Ydim).
    • Tdim

      private int Tdim
      Time dimension of the image.
    • Xdim

      private int Xdim
      X dimension of the image.
    • Ydim

      private int Ydim
      Y dimension of the image.
    • colorFactor

      private int colorFactor
  • Constructor Details

    • AlgorithmCorrectSpacing

      public AlgorithmCorrectSpacing(ModelImage srcImage, ModelImage resultImage, int numRepIm, int numBlanks)
      Import source image into the class.
      Parameters:
      srcImage - source image (image to clip from)
      resultImage - corrected image
      numRepIm - number of times to repeat each of original images
      numBlanks - number of blank images to insert
  • Method Details

    • disposeLocal

      public void disposeLocal()
      Dispose of local variables that may be taking up lots of room.
    • finalize

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

      public ModelImage getResultImage()
      Returns corrected image.
      Returns:
      resultImage
    • runAlgorithm

      public void runAlgorithm()
      Runs algorithm.
      Specified by:
      runAlgorithm in class AlgorithmBase