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 TypeMethodDescriptiondouble
Calculates a value for some input.protected abstract double
calculateStatisticFrom
(Histogram histogram) Calculates the statistic from the histogram, that is subsequently returned as the feature-value.double
The value to return iffexceptionifEmpty
is false.boolean
If true, then an exception is thrown if the histogram is empty, otherwisevalueIfEmpty
is returned.void
setExceptionIfEmpty
(boolean exceptionIfEmpty) If true, then an exception is thrown if the histogram is empty, otherwisevalueIfEmpty
is returned.void
setValueIfEmpty
(double valueIfEmpty) The value to return iffexceptionifEmpty
is false.Methods inherited from class org.anchoranalysis.image.feature.bean.FeatureHistogram
inputType
Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculateCheckInitialized, castAs, createListChildFeatures, describeBean, describeParameters, descriptionLong, duplicateChangeName, getCustomName, getFriendlyName, onInitialization, setCustomName, toString
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, 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:Feature
Calculates a value for some input.- Specified by:
calculate
in 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, otherwisevalueIfEmpty
is returned. -
setExceptionIfEmpty
public void setExceptionIfEmpty(boolean exceptionIfEmpty) If true, then an exception is thrown if the histogram is empty, otherwisevalueIfEmpty
is returned. -
getValueIfEmpty
public double getValueIfEmpty()The value to return iffexceptionifEmpty
is false. -
setValueIfEmpty
public void setValueIfEmpty(double valueIfEmpty) The value to return iffexceptionifEmpty
is false.
-