Class FeatureSingleObjectFromShared<T extends FeatureInputEnergy>

Object
AnchorBean<Feature<T>>
InitializableBean<Feature<T>, FeatureInitialization>
Feature<T>
FeatureEnergy<T>
FeatureSingleObjectFromShared<T>
Type Parameters:
T - feature-input type that extends FeatureInputEnergy
Direct Known Subclasses:
MaskAsSingleObject, ObjectAggregationBase

public abstract class FeatureSingleObjectFromShared<T extends FeatureInputEnergy> extends 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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    beforeCalc(FeatureInitialization initialization)
     
    protected abstract void
    beforeCalcWithInitialization(ImageInitialization initialization)
    Performs initialization before calculation with image-specific initialization.
    protected abstract double
    calc(CalculateForChild<T> calculateForChild, Feature<FeatureInputSingleObject> featureForSingleObject)
    Calculates the feature value for a single object.
    double
    calculate(FeatureCalculationInput<T> input)
     
    Feature<FeatureInputSingleObject>
    The feature to be calculated on a single object.
    Class<? extends FeatureInput>
     
    void
    setItem(Feature<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, 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FeatureSingleObjectFromShared

      public FeatureSingleObjectFromShared()
  • Method Details

    • beforeCalc

      protected void beforeCalc(FeatureInitialization initialization) throws InitializeException
      Overrides:
      beforeCalc in class Feature<T extends FeatureInputEnergy>
      Throws:
      InitializeException
    • beforeCalcWithInitialization

      protected abstract void beforeCalcWithInitialization(ImageInitialization initialization) throws InitializeException
      Performs initialization before calculation with image-specific initialization.
      Parameters:
      initialization - the image-specific initialization
      Throws:
      InitializeException - if initialization fails
    • calculate

      public double calculate(FeatureCalculationInput<T> input) throws FeatureCalculationException
      Specified by:
      calculate in class Feature<T extends FeatureInputEnergy>
      Throws:
      FeatureCalculationException
    • calc

      protected abstract double calc(CalculateForChild<T> calculateForChild, Feature<FeatureInputSingleObject> featureForSingleObject) throws FeatureCalculationException
      Calculates the feature value for a single object.
      Parameters:
      calculateForChild - the calculation context for child features
      featureForSingleObject - the feature to calculate on a single object
      Returns:
      the calculated feature value
      Throws:
      FeatureCalculationException - if the calculation fails
    • inputType

      public Class<? extends FeatureInput> inputType()
      Overrides:
      inputType in class FeatureEnergy<T extends FeatureInputEnergy>
    • getItem

      public Feature<FeatureInputSingleObject> getItem()
      The feature to be calculated on a single object.
    • setItem

      public void setItem(Feature<FeatureInputSingleObject> item)
      The feature to be calculated on a single object.