Class AlgorithmThresholdDualRGB

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

public class AlgorithmThresholdDualRGB extends AlgorithmBase
Runs threshold (lower and upper) on color images and replaces values either outside (inverse) or inside (normal) with the fill values specified.
Version:
1.0
Author:
Ben Link
  • Field Details

    • entireImage

      private boolean entireImage
      Flag, if true, indicates that the whole image should be processed. If false on process the image over the mask areas.
    • fillValues

      private float[] fillValues
      Arrays containing fill values for each channel (red=0,green=1,blue=2).
    • isInverse

      private boolean isInverse
      fill values are for values outside (inverse) or inside (normal/false).
    • thresholdB

      private float[] thresholdB
      DOCUMENT ME!
    • thresholdG

      private float[] thresholdG
      DOCUMENT ME!
    • thresholdR

      private float[] thresholdR
      Three arrays (R,G,B) containing minimum and maximum threshold for each channel.
    • useChannels

      private boolean[] useChannels
      Which channels to use (0 = red, 1 = green, 2 = blue).
    • pixelsInRangeR

      private int pixelsInRangeR
      Variable that will store the total number of red pixel values in thresholding range
    • pixelsInRangeG

      private int pixelsInRangeG
      Variable that will store the total number of green pixel values in thresholding range
    • pixelsInRangeB

      private int pixelsInRangeB
      Variable that will store the total number of blue pixel values in thresholding range
  • Constructor Details

    • AlgorithmThresholdDualRGB

      public AlgorithmThresholdDualRGB(ModelImage srcImage, float[] thresholdR, float[] thresholdG, float[] thresholdB, float[] fillValues, boolean[] useChannels, boolean maskFlag, boolean isInverse)
      Default constructor for running algorithm on and modifying source image.
      Parameters:
      srcImage - ModelImage source
      thresholdR - float[] red thresh
      thresholdG - float[] green thresh
      thresholdB - float[] blue thresh
      fillValues - float[] fill values [3] (r,g,b)
      useChannels - boolean[] use channels [3] (r,g,b)
      maskFlag - boolean whole image or voi
      isInverse - boolean replace values outside (true) or inside (false)
    • AlgorithmThresholdDualRGB

      public AlgorithmThresholdDualRGB(ModelImage destImg, ModelImage srcImg, float[] thresholdR, float[] thresholdG, float[] thresholdB, float[] fillValues, boolean[] useChannels, boolean maskFlag, boolean isInverse)
      Default constructor for running algorithm into a destination image.
      Parameters:
      destImg - ModelImage destination
      srcImg - ModelImage source
      thresholdR - float[] red thresh
      thresholdG - float[] green thresh
      thresholdB - float[] blue thresh
      fillValues - float[] fill values [3] (r,g,b)
      useChannels - boolean[] use channels [3] (r,g,b)
      maskFlag - boolean whole image or voi
      isInverse - boolean replace values outside (true) or inside (false)
  • Method Details

    • finalize

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

      public void runAlgorithm()
      Starts the program.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • calcInPlace2D

      private void calcInPlace2D()
      Replace 2D source image with the thresholded image.
    • calcInPlace34D

      private void calcInPlace34D()
      Replace 3D or 4D source image with the thresholded image.
    • calcStoreInDest2D

      private void calcStoreInDest2D()
      Stores the thresholded image into the destination image.
    • calcStoreInDest34D

      private void calcStoreInDest34D()
      Stores the thresholded image into the destination image.
    • setThresholdStatistics

      private void setThresholdStatistics()