Class CombineObjectsForFeatures<T extends FeatureInput>

Object
AnchorBean<CombineObjectsForFeatures<T>>
CombineObjectsForFeatures<T>
Type Parameters:
T - type of feature used in the table
Direct Known Subclasses:
EachObjectIndependently, PairNeighbors

public abstract class CombineObjectsForFeatures<T extends FeatureInput> extends AnchorBean<CombineObjectsForFeatures<T>>
A way to combine (or not combine) objects so that they provide a feature-table.

Columns in the feature-table always represent features.

A row may represent a single object, or a pair of objects, or any other derived inputs from an object-collection, depending on the implementation of the sub-class.

Author:
Owen Feehan
  • Constructor Details

    • CombineObjectsForFeatures

      protected CombineObjectsForFeatures(Interpolator interpolator)
      Create with a specific interpolator.
      Parameters:
      interpolator - interpolator used to resize images in thumbnail generation.
    • CombineObjectsForFeatures

      public CombineObjectsForFeatures()
  • Method Details

    • checkMisconfigured

      public void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
      Checks if the bean is misconfigured and saves the default instances for later use.
      Overrides:
      checkMisconfigured in class AnchorBean<CombineObjectsForFeatures<T extends FeatureInput>>
      Parameters:
      defaultInstances - the BeanInstanceMap containing default instances
      Throws:
      BeanMisconfiguredException - if the bean is misconfigured
    • createFeatures

      public abstract FeatureTableCalculator<T> createFeatures(List<NamedBean<FeatureListProvider<FeatureInputSingleObject>>> featuresSingleObject, NamedFeatureStoreFactory storeFactory, boolean suppressErrors) throws CreateException, InitializeException
      Creates features that will be applied on the objects. Features should always be duplicated from the input list.
      Parameters:
      featuresSingleObject - beans defining features to be applied to single-objects.
      storeFactory - creates a new NamedFeatureStore as needed.
      suppressErrors - when true, exceptions aren't thrown when feature-calculations fail, but rather a log error message is written.
      Returns:
      a FeatureTableCalculator for feature tables that may apply various features derived from featuresSingleObject.
      Throws:
      CreateException - if there's an error creating the features.
      InitializeException - if there's an error initializing the features.
    • uniqueIdentifierFor

      public abstract String uniqueIdentifierFor(T input)
      Generates a unique identifier for a particular input.
      Parameters:
      input - the input to generate a unique identifier for
      Returns:
      a unique identifier string
    • deriveInputsStartBatch

      public ListWithThumbnails<T,ObjectCollection> deriveInputsStartBatch(ObjectCollection objects, EnergyStack energyStack, boolean thumbnailsEnabled, OperationContext context) throws CreateException
      Derives a list of inputs (i.e. rows in a feature table) and starts a batch of related thumbnail generation.
      Parameters:
      objects - the objects from which inputs are derived.
      energyStack - energy-stack used during feature calculation.
      thumbnailsEnabled - whether thumbnail-generation is enabled.
      context - context in which the operation occurs.
      Returns:
      the list of inputs.
      Throws:
      CreateException - if an error occurs deriving or creating the thumbnails.
    • objectsForThumbnail

      public abstract ObjectCollection objectsForThumbnail(T input) throws CreateException
      Selects objects from an input that will be used for thumbnail generation.
      Parameters:
      input - the input
      Returns:
      the ObjectCollection for thumbnail generation
      Throws:
      CreateException - if there's an error creating the object collection
    • startBatchDeriveInputs

      protected abstract List<T> startBatchDeriveInputs(ObjectCollection objects, EnergyStack energyStack, Logger logger) throws CreateException
      Derives a list of inputs from an object-collection.
      Parameters:
      objects - the object-collection
      energyStack - energy-stack used during feature calculation
      logger - the logger
      Returns:
      the list of inputs
      Throws:
      CreateException - if there's an error deriving the inputs
    • boundingBoxThatSpansInput

      protected abstract BoundingBox boundingBoxThatSpansInput(T input)
      Creates a bounding-box that tightly fits the input to a particular table row (could be for one or more objects).
      Parameters:
      input - the input
      Returns:
      a BoundingBox that fully fits around all objects used in input
    • getThumbnail

      public ThumbnailFromObjects getThumbnail()
      Generates a thumbnail representation of one or more combined objects, as form a single input.

      If not set, a thumbnail will be created with an outline around selected and unselected objects.

    • setThumbnail

      public void setThumbnail(ThumbnailFromObjects thumbnail)
      Generates a thumbnail representation of one or more combined objects, as form a single input.

      If not set, a thumbnail will be created with an outline around selected and unselected objects.

    • getInterpolator

      public Interpolator getInterpolator()
      Interpolator used to resize images in thumbnail generation.
    • setInterpolator

      public void setInterpolator(Interpolator interpolator)
      Interpolator used to resize images in thumbnail generation.