Class AlgorithmReplaceRemovedSlices

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

public class AlgorithmReplaceRemovedSlices extends AlgorithmBase
This algorithm is used to insert averaged slices where slices have been removed -If slices were removed at the beginning of the original movie, these slices will not be replaced. - Slices are only inserted between the first and last kept slices
Author:
Ben Link
  • Field Details

    • destFlag

      private boolean destFlag
      DOCUMENT ME!
    • imageMin

      private float imageMin
      DOCUMENT ME!
    • insertBlank

      private boolean insertBlank
      If true, insert a blank rather than a weighted average.
    • isDicom

      private boolean isDicom
      DOCUMENT ME!
    • isSplit

      private boolean isSplit
      DOCUMENT ME!
    • removedSlices

      private boolean[] removedSlices
      every false value in the array corresponds to a slice within the movie passed in. true values represent removed slices
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
  • Constructor Details

    • AlgorithmReplaceRemovedSlices

      public AlgorithmReplaceRemovedSlices(ModelImage srcImage, boolean[] removedSlices, boolean isSplit, boolean destFlag, boolean insertBlank)
      Constructor for algorithm.
      Parameters:
      srcImage - the source image
      removedSlices - an array showing which slices were removed
      isSplit - DOCUMENT ME!
      destFlag - DOCUMENT ME!
      insertBlank - If true, insert a blank rather than a weighted average
  • Method Details

    • disposeLocal

      public void disposeLocal()
      Local cleanup.
    • finalize

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

      public ModelImage getResultImage()
      Retrieves the result image.
      Returns:
      resultImage the new image
    • runAlgorithm

      public void runAlgorithm()
      Function called by thread to run the algorithm.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • insertAveragedSlices

      private void insertAveragedSlices(float[] buffer1, float[] buffer2, int start, int end)
      Insert weighted averaged slices between the two indices.
      Parameters:
      buffer1 - empty buffer to hold the first slice
      buffer2 - empty buffer to hold the last slice
      start - start index
      end - end index
    • insertBlankSlices

      private void insertBlankSlices(float[] buffer1, int start, int end)
      Insert blank slices between the two indices.
      Parameters:
      buffer1 - empty buffer to hold the minimum value
      start - start index
      end - end index