Class DerivedObject
Object
AnchorBean<Feature<FeatureInputSingleObject>>
InitializableBean<Feature<FeatureInputSingleObject>, FeatureInitialization>
Feature<FeatureInputSingleObject>
FeatureSingleObject
DerivedObject
public abstract class DerivedObject
extends FeatureSingleObject
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.doublecalculate(FeatureCalculationInput<FeatureInputSingleObject> input) protected abstract CalculationPart<ObjectMask, FeatureInputSingleObject> createCachedCalculationForDerived(CalculationPartResolver<FeatureInputSingleObject> session) Creates aCalculationPartfor deriving the object mask.doubleThe value to return when the derived object is empty.Feature<FeatureInputSingleObject> getItem()The feature to calculate on the derived object.voidsetEmptyValue(double emptyValue) The value to return when the derived object is empty.voidsetItem(Feature<FeatureInputSingleObject> item) The 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 - Specified by:
calculatein classFeature<FeatureInputSingleObject>- Throws:
FeatureCalculationException
-
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
protected abstract ChildCacheName 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
public Feature<FeatureInputSingleObject> getItem()The feature to calculate on the derived object. -
setItem
public void setItem(Feature<FeatureInputSingleObject> item) The feature to calculate on the derived object.
-