Class FeatureHistogramStatistic
Object
- Direct Known Subclasses:
CoefficientOfVariation,Count,Kurtosis,Maximum,Mean,MeanRaisedToPower,Median,Minimum,Mode,NumberDistinctValues,Quantile,Range,RatioNonMode,RatioThreshold,Skewness,StandardDeviation,Sum,TotalCount,Variance
Base class for
FeatureHistogram implementations that calculate a statistic from the
Histogram.- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleCalculates a value for some input.protected abstract doublecalculateStatisticFrom(Histogram histogram) Calculates the statistic from the histogram, that is subsequently returned as the feature-value.doubleThe value to return iffexceptionifEmptyis false.booleanIf true, then an exception is thrown if the histogram is empty, otherwisevalueIfEmptyis returned.voidsetExceptionIfEmpty(boolean exceptionIfEmpty) If true, then an exception is thrown if the histogram is empty, otherwisevalueIfEmptyis returned.voidsetValueIfEmpty(double valueIfEmpty) The value to return iffexceptionifEmptyis false.Methods inherited from class org.anchoranalysis.image.feature.bean.FeatureHistogram
inputTypeMethods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, describeParameters, descriptionLong, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toStringMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitializedMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
-
Constructor Details
-
FeatureHistogramStatistic
public FeatureHistogramStatistic()
-
-
Method Details
-
calculate
public double calculate(FeatureCalculationInput<FeatureInputHistogram> input) throws FeatureCalculationException Description copied from class:FeatureCalculates a value for some input.- Specified by:
calculatein classFeature<FeatureInputHistogram>- Parameters:
input- the input to the calculation.- Returns:
- the result of the calculation.
- Throws:
FeatureCalculationException- if the calculation cannot successfully complete.
-
calculateStatisticFrom
protected abstract double calculateStatisticFrom(Histogram histogram) throws FeatureCalculationException Calculates the statistic from the histogram, that is subsequently returned as the feature-value.- Parameters:
histogram- the histogram to calculate the statistic from.- Returns:
- the calculated statistic.
- Throws:
FeatureCalculationException- if the calculation cannot succeed.
-
isExceptionIfEmpty
public boolean isExceptionIfEmpty()If true, then an exception is thrown if the histogram is empty, otherwisevalueIfEmptyis returned. -
setExceptionIfEmpty
public void setExceptionIfEmpty(boolean exceptionIfEmpty) If true, then an exception is thrown if the histogram is empty, otherwisevalueIfEmptyis returned. -
getValueIfEmpty
public double getValueIfEmpty()The value to return iffexceptionifEmptyis false. -
setValueIfEmpty
public void setValueIfEmpty(double valueIfEmpty) The value to return iffexceptionifEmptyis false.
-