Class FeatureSingleObjectFromShared<T extends org.anchoranalysis.feature.input.FeatureInputEnergy>
Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<org.anchoranalysis.feature.bean.Feature<T>,org.anchoranalysis.feature.initialization.FeatureInitialization>
org.anchoranalysis.feature.bean.Feature<T>
org.anchoranalysis.image.feature.bean.FeatureEnergy<T>
org.anchoranalysis.plugin.image.feature.bean.shared.object.FeatureSingleObjectFromShared<T>
- Type Parameters:
T- feature-input type that extendsFeatureInputEnergy
- Direct Known Subclasses:
MaskAsSingleObject,ObjectAggregationBase
public abstract class FeatureSingleObjectFromShared<T extends org.anchoranalysis.feature.input.FeatureInputEnergy>
extends org.anchoranalysis.image.feature.bean.FeatureEnergy<T>
Calculates object-masks from entities in shared, using the feature-input only for an
energy-stack.
This abstract class extends FeatureEnergy to provide a base for features that operate
on single objects from shared data.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description FeatureSingleObjectFromShared() -
Method Summary
Modifier and Type Method Description protected voidbeforeCalc(org.anchoranalysis.feature.initialization.FeatureInitialization initialization)protected abstract voidbeforeCalcWithInitialization(org.anchoranalysis.image.bean.nonbean.init.ImageInitialization initialization)Performs initialization before calculation with image-specific initialization.protected abstract doublecalc(org.anchoranalysis.feature.calculate.cache.CalculateForChild<T> calculateForChild, org.anchoranalysis.feature.bean.Feature<org.anchoranalysis.image.feature.input.FeatureInputSingleObject> featureForSingleObject)Calculates the feature value for a single object.doublecalculate(org.anchoranalysis.feature.calculate.FeatureCalculationInput<T> input)org.anchoranalysis.feature.bean.Feature<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>getItem()The feature to be calculated on a single object.Class<? extends org.anchoranalysis.feature.input.FeatureInput>inputType()voidsetItem(org.anchoranalysis.feature.bean.Feature<org.anchoranalysis.image.feature.input.FeatureInputSingleObject> item)The feature to be calculated on a single object.Methods inherited from class org.anchoranalysis.feature.bean.Feature
assignTo, 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, isInitialized
-
Constructor Details
-
FeatureSingleObjectFromShared
public FeatureSingleObjectFromShared()
-
-
Method Details
-
beforeCalc
protected void beforeCalc(org.anchoranalysis.feature.initialization.FeatureInitialization initialization) throws org.anchoranalysis.core.exception.InitializeException- Overrides:
beforeCalcin classorg.anchoranalysis.feature.bean.Feature<T extends org.anchoranalysis.feature.input.FeatureInputEnergy>- Throws:
org.anchoranalysis.core.exception.InitializeException
-
beforeCalcWithInitialization
protected abstract void beforeCalcWithInitialization(org.anchoranalysis.image.bean.nonbean.init.ImageInitialization initialization) throws org.anchoranalysis.core.exception.InitializeExceptionPerforms initialization before calculation with image-specific initialization.- Parameters:
initialization- the image-specific initialization- Throws:
org.anchoranalysis.core.exception.InitializeException- if initialization fails
-
calculate
public double calculate(org.anchoranalysis.feature.calculate.FeatureCalculationInput<T> input) throws org.anchoranalysis.feature.calculate.FeatureCalculationException- Specified by:
calculatein classorg.anchoranalysis.feature.bean.Feature<T extends org.anchoranalysis.feature.input.FeatureInputEnergy>- Throws:
org.anchoranalysis.feature.calculate.FeatureCalculationException
-
calc
protected abstract double calc(org.anchoranalysis.feature.calculate.cache.CalculateForChild<T> calculateForChild, org.anchoranalysis.feature.bean.Feature<org.anchoranalysis.image.feature.input.FeatureInputSingleObject> featureForSingleObject) throws org.anchoranalysis.feature.calculate.FeatureCalculationExceptionCalculates the feature value for a single object.- Parameters:
calculateForChild- the calculation context for child featuresfeatureForSingleObject- the feature to calculate on a single object- Returns:
- the calculated feature value
- Throws:
org.anchoranalysis.feature.calculate.FeatureCalculationException- if the calculation fails
-
inputType
- Overrides:
inputTypein classorg.anchoranalysis.image.feature.bean.FeatureEnergy<T extends org.anchoranalysis.feature.input.FeatureInputEnergy>
-
getItem
public org.anchoranalysis.feature.bean.Feature<org.anchoranalysis.image.feature.input.FeatureInputSingleObject> getItem()The feature to be calculated on a single object. -
setItem
public void setItem(org.anchoranalysis.feature.bean.Feature<org.anchoranalysis.image.feature.input.FeatureInputSingleObject> item)The feature to be calculated on a single object.
-