Class CalculateLevelRelativeToThreshold

Object
AnchorBean<CalculateLevel>
InitializableBean<CalculateLevel, NullInitialization>
NullParametersBean<CalculateLevel>
CalculateLevel
CalculateLevelUnary
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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    calculateLevel(Histogram histogram)
     
    protected boolean
     
    boolean
     
    CalculateLevel
    Alternative CalculateLevel to use when the condition in useElseInstead(int, int) is met.
    int
    Threshold value to compare against when deciding whether to use the alternative calculation.
    int
     
    void
    setCalculateLevelElse(CalculateLevel calculateLevelElse)
    Alternative CalculateLevel to use when the condition in useElseInstead(int, int) is met.
    void
    setThreshold(int threshold)
    Threshold value to compare against when deciding whether to use the alternative calculation.
    protected abstract boolean
    useElseInstead(int level, int threshold)
    Determines whether to use the alternative calculation method.

    Methods inherited from class org.anchoranalysis.image.bean.threshold.CalculateLevelUnary

    calculateLevelFromDelegate, getCalculateLevel, setCalculateLevel

    Methods inherited from class org.anchoranalysis.bean.NullParametersBean

    initializeRecursive, onInitialization, onInitialization

    Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean

    getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CalculateLevelRelativeToThreshold

      public CalculateLevelRelativeToThreshold()
  • Method Details

    • calculateLevel

      public int calculateLevel(Histogram histogram) throws OperationFailedException
      Specified by:
      calculateLevel in class CalculateLevel
      Throws:
      OperationFailedException
    • 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.