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 -
Method Summary
Modifier and TypeMethodDescriptionintcalculateLevel(Histogram histogram) protected booleanbooleanCalculateLevelAlternativeCalculateLevelto use when the condition inuseElseInstead(int, int)is met.intThreshold value to compare against when deciding whether to use the alternative calculation.inthashCode()voidsetCalculateLevelElse(CalculateLevel calculateLevelElse) AlternativeCalculateLevelto use when the condition inuseElseInstead(int, int)is met.voidsetThreshold(int threshold) Threshold value to compare against when deciding whether to use the alternative calculation.protected abstract booleanuseElseInstead(int level, int threshold) Determines whether to use the alternative calculation method.Methods inherited from class org.anchoranalysis.image.bean.threshold.CalculateLevelUnary
calculateLevelFromDelegate, getCalculateLevel, setCalculateLevelMethods inherited from class org.anchoranalysis.bean.NullParametersBean
initializeRecursive, onInitialization, onInitializationMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitializedMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
CalculateLevelRelativeToThreshold
public CalculateLevelRelativeToThreshold()
-
-
Method Details
-
calculateLevel
public int calculateLevel(Histogram histogram) throws OperationFailedException - Specified by:
calculateLevelin classCalculateLevel- 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 delegateCalculateLevelthreshold- the threshold value to compare against- Returns:
- true if the alternative calculation method should be used, false otherwise
-
equals
- Overrides:
equalsin classCalculateLevelUnary
-
canEqual
- Overrides:
canEqualin classCalculateLevelUnary
-
hashCode
public int hashCode()- Overrides:
hashCodein classCalculateLevelUnary
-
getCalculateLevelElse
public CalculateLevel getCalculateLevelElse()AlternativeCalculateLevelto use when the condition inuseElseInstead(int, int)is met. -
setCalculateLevelElse
public void setCalculateLevelElse(CalculateLevel calculateLevelElse) AlternativeCalculateLevelto use when the condition inuseElseInstead(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.
-