Class FeatureDeriveFromPair
- Direct Known Subclasses:
First
,Intersection
,Merged
,Minimum
,RatioFirstToSecond
,Second
,SubtractSecondFromFirst
Base class for evaluating
FeaturePairObjects
in terms of another feature that operates on
elements (first, second, merged etc.).
This class provides methods to calculate feature values for the first, second, and merged objects in a pair, using a specified feature for single objects.
- Author:
- Owen Feehan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChildCacheName
Cache name for the first object in the pair.static final ChildCacheName
Cache name for the merged object from the pair.static final ChildCacheName
Cache name for the second object in the pair. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newFeatureDeriveFromPair
instance. -
Method Summary
Modifier and TypeMethodDescriptiongetItem()
The feature to be applied to individual objects.void
The feature to be applied to individual objects.protected double
Calculates the feature value for the first object in the pair.protected double
Calculates the feature value for the merged object from the pair.protected double
Calculates the feature value for the second object in the pair.Methods inherited from class org.anchoranalysis.image.feature.bean.object.pair.FeaturePairObjects
inputType
Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculate, 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
-
Field Details
-
CACHE_NAME_FIRST
Cache name for the first object in the pair. -
CACHE_NAME_SECOND
Cache name for the second object in the pair. -
CACHE_NAME_MERGED
Cache name for the merged object from the pair.
-
-
Constructor Details
-
FeatureDeriveFromPair
public FeatureDeriveFromPair() -
FeatureDeriveFromPair
Creates a newFeatureDeriveFromPair
instance.- Parameters:
item
- The feature to be applied to individual objects.
-
-
Method Details
-
valueFromFirst
protected double valueFromFirst(FeatureCalculationInput<FeatureInputPairObjects> input) throws FeatureCalculationException Calculates the feature value for the first object in the pair.- Parameters:
input
- the input for feature calculation- Returns:
- the calculated feature value for the first object
- Throws:
FeatureCalculationException
- if an error occurs during calculation
-
valueFromSecond
protected double valueFromSecond(FeatureCalculationInput<FeatureInputPairObjects> input) throws FeatureCalculationException Calculates the feature value for the second object in the pair.- Parameters:
input
- the input for feature calculation- Returns:
- the calculated feature value for the second object
- Throws:
FeatureCalculationException
- if an error occurs during calculation
-
valueFromMerged
protected double valueFromMerged(FeatureCalculationInput<FeatureInputPairObjects> input) throws FeatureCalculationException Calculates the feature value for the merged object from the pair.- Parameters:
input
- the input for feature calculation- Returns:
- the calculated feature value for the merged object
- Throws:
FeatureCalculationException
- if an error occurs during calculation
-
getItem
The feature to be applied to individual objects. -
setItem
The feature to be applied to individual objects.
-