Class CalculateLevelRelativeToThreshold

Direct Known Subclasses:
IfGreaterThan, IfLessThan

public abstract class CalculateLevelRelativeToThreshold extends CalculateLevelUnary
A CalculateLevelUnary that calculates a level relative to a threshold, with an alternative calculation method.
  • Constructor Details

    • CalculateLevelRelativeToThreshold

      public CalculateLevelRelativeToThreshold()
  • Method Details

    • calculateLevel

      public int calculateLevel(Histogram histogram) throws OperationFailedException
      Description copied from class: CalculateLevel
      Determines a voxel intensity that can be used for thresholding.
      Specified by:
      calculateLevel in class CalculateLevel
      Parameters:
      histogram - a histogram of voxel-intensities from which a threshold-level can be derived.
      Returns:
      the threshold-level.
      Throws:
      OperationFailedException - if a level cannot be successfully calculated.
    • useElseInstead

      protected abstract boolean useElseInstead(int level, int threshold)
      Determines whether to use the alternative calculation method.
      Parameters:
      level - the level calculated by the delegate CalculateLevel
      threshold - the threshold value to compare against
      Returns:
      true if the alternative calculation method should be used, false otherwise
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class CalculateLevelUnary
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class CalculateLevelUnary
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class CalculateLevelUnary
    • getCalculateLevelElse

      public CalculateLevel getCalculateLevelElse()
      Alternative CalculateLevel to use when the condition in useElseInstead(int, int) is met.
    • setCalculateLevelElse

      public void setCalculateLevelElse(CalculateLevel calculateLevelElse)
      Alternative CalculateLevel to use when the condition in useElseInstead(int, int) is met.
    • getThreshold

      public int getThreshold()
      Threshold value to compare against when deciding whether to use the alternative calculation.
    • setThreshold

      public void setThreshold(int threshold)
      Threshold value to compare against when deciding whether to use the alternative calculation.