Class FeatureDeriveFromPair
Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<Feature<T>,FeatureInitialization>
org.anchoranalysis.feature.bean.Feature<FeatureInputPairObjects>
org.anchoranalysis.image.feature.bean.object.pair.FeaturePairObjects
org.anchoranalysis.image.feature.bean.object.pair.FeatureDeriveFromPair
- Direct Known Subclasses:
First,Merged,Minimum,RatioFirstToSecond,Second,SubtractSecondFromFirst
public abstract class FeatureDeriveFromPair extends FeaturePairObjects
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
Fields Modifier and Type Field Description static ChildCacheNameCACHE_NAME_FIRSTCache name for the first object in the pair.static ChildCacheNameCACHE_NAME_MERGEDCache name for the merged object from the pair.static ChildCacheNameCACHE_NAME_SECONDCache name for the second object in the pair. -
Constructor Summary
Constructors Constructor Description FeatureDeriveFromPair()FeatureDeriveFromPair(Feature<FeatureInputSingleObject> item) -
Method Summary
Modifier and Type Method Description Feature<FeatureInputSingleObject>getItem()The feature to be applied to individual objects.voidsetItem(Feature<FeatureInputSingleObject> item)The feature to be applied to individual objects.protected doublevalueFromFirst(FeatureCalculationInput<FeatureInputPairObjects> input)Calculates the feature value for the first object in the pair.protected doublevalueFromMerged(FeatureCalculationInput<FeatureInputPairObjects> input)Calculates the feature value for the merged object from the pair.protected doublevalueFromSecond(FeatureCalculationInput<FeatureInputPairObjects> input)Calculates the feature value for the second object in the pair.Methods inherited from class org.anchoranalysis.image.feature.bean.object.pair.FeaturePairObjects
inputTypeMethods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, beforeCalc, calculate, 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
-
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
-
-
Method Details
-
valueFromFirst
protected double valueFromFirst(FeatureCalculationInput<FeatureInputPairObjects> input) throws FeatureCalculationExceptionCalculates 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 FeatureCalculationExceptionCalculates 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 FeatureCalculationExceptionCalculates 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.
-