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 TypeMethodDescriptionint
calculateLevel
(Histogram histogram) Determines a voxel intensity that can be used for thresholding.protected boolean
boolean
AlternativeCalculateLevel
to use when the condition inuseElseInstead(int, int)
is met.int
Threshold value to compare against when deciding whether to use the alternative calculation.int
hashCode()
void
setCalculateLevelElse
(CalculateLevel calculateLevelElse) AlternativeCalculateLevel
to use when the condition inuseElseInstead(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
-
Constructor Details
-
CalculateLevelRelativeToThreshold
public CalculateLevelRelativeToThreshold()
-
-
Method Details
-
calculateLevel
Description copied from class:CalculateLevel
Determines a voxel intensity that can be used for thresholding.- Specified by:
calculateLevel
in 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 delegateCalculateLevel
threshold
- the threshold value to compare against- Returns:
- true if the alternative calculation method should be used, false otherwise
-
equals
- Overrides:
equals
in classCalculateLevelUnary
-
canEqual
- Overrides:
canEqual
in classCalculateLevelUnary
-
hashCode
public int hashCode()- Overrides:
hashCode
in classCalculateLevelUnary
-
getCalculateLevelElse
AlternativeCalculateLevel
to use when the condition inuseElseInstead(int, int)
is met. -
setCalculateLevelElse
AlternativeCalculateLevel
to 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.
-