Class CalculateLevelRelativeToThreshold
Object
AnchorBean<CalculateLevel>
InitializableBean<CalculateLevel,NullInitialization>
NullParametersBean<CalculateLevel>
CalculateLevel
CalculateLevelUnary
CalculateLevelRelativeToThreshold
- Direct Known Subclasses:
IfGreaterThan,IfLessThan
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) Determines a voxel intensity that can be used for thresholding.protected booleanbooleanAlternativeCalculateLevelto 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
Description copied from class:CalculateLevelDetermines a voxel intensity that can be used for thresholding.- Specified by:
calculateLevelin classCalculateLevel- 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 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
AlternativeCalculateLevelto use when the condition inuseElseInstead(int, int)is met. -
setCalculateLevelElse
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.
-