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 ChildCacheName
Provides a unique name for caching the derived object.double
Calculates a value for some input.protected abstract CalculationPart
<ObjectMask, FeatureInputSingleObject> Creates aCalculationPart
for deriving the object mask.double
The value to return when the derived object is empty.getItem()
The feature to calculate on the derived object.void
setEmptyValue
(double emptyValue) The value to return when the derived object is empty.void
The feature to calculate on the derived object.Methods inherited from class org.anchoranalysis.image.feature.bean.object.single.FeatureSingleObject
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
-
DerivedObject
public DerivedObject()
-
-
Method Details
-
calculate
public double calculate(FeatureCalculationInput<FeatureInputSingleObject> input) throws FeatureCalculationException Description copied from class:Feature
Calculates a value for some input.- Specified by:
calculate
in 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 aCalculationPart
for deriving the object mask.- Parameters:
session
- theCalculationPartResolver
for resolving calculation parts- Returns:
- a
CalculationPart
that derives anObjectMask
- Throws:
FeatureCalculationException
- if the calculation fails
-
cacheName
Provides a unique name for caching the derived object.- Returns:
- a
ChildCacheName
for 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.
-