Class DerivedObject
A base class for features that operate on a derived object mask and calculate a feature on it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ChildCacheNameProvides a unique name for caching the derived object.doubleCalculates a value for some input.protected abstract CalculationPart<ObjectMask, FeatureInputSingleObject> Creates aCalculationPartfor deriving the object mask.doubleThe value to return when the derived object is empty.getItem()The feature to calculate on the derived object.voidsetEmptyValue(double emptyValue) The value to return when the derived object is empty.voidThe feature to calculate on the derived object.Methods inherited from class org.anchoranalysis.image.feature.bean.object.single.FeatureSingleObject
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
-
DerivedObject
public DerivedObject()
-
-
Method Details
-
calculate
public double calculate(FeatureCalculationInput<FeatureInputSingleObject> input) throws FeatureCalculationException Description copied from class:FeatureCalculates a value for some input.- Specified by:
calculatein classFeature<FeatureInputSingleObject>- Parameters:
input- the input to the calculation.- Returns:
- the result of the calculation.
- Throws:
FeatureCalculationException- if the calculation cannot successfully complete.
-
createCachedCalculationForDerived
protected abstract CalculationPart<ObjectMask,FeatureInputSingleObject> createCachedCalculationForDerived(CalculationPartResolver<FeatureInputSingleObject> session) throws FeatureCalculationException Creates aCalculationPartfor deriving the object mask.- Parameters:
session- theCalculationPartResolverfor resolving calculation parts- Returns:
- a
CalculationPartthat derives anObjectMask - Throws:
FeatureCalculationException- if the calculation fails
-
cacheName
Provides a unique name for caching the derived object.- Returns:
- a
ChildCacheNamefor caching the derived object
-
getEmptyValue
public double getEmptyValue()The value to return when the derived object is empty. -
setEmptyValue
public void setEmptyValue(double emptyValue) The value to return when the derived object is empty. -
getItem
The feature to calculate on the derived object. -
setItem
The feature to calculate on the derived object.
-