Class CombineObjectsForFeatures<T extends org.anchoranalysis.feature.input.FeatureInput>

Object
org.anchoranalysis.bean.AnchorBean<CombineObjectsForFeatures<T>>
org.anchoranalysis.plugin.image.feature.bean.object.combine.CombineObjectsForFeatures<T>
Type Parameters:
T - type of feature used in the table
Direct Known Subclasses:
EachObjectIndependently, PairNeighbors

public abstract class CombineObjectsForFeatures<T extends org.anchoranalysis.feature.input.FeatureInput>
extends org.anchoranalysis.bean.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 Summary

    Constructors 
    Modifier Constructor Description
      CombineObjectsForFeatures()  
    protected CombineObjectsForFeatures​(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)
    Create with a specific interpolator.
  • Method Summary

    Modifier and Type Method Description
    protected abstract org.anchoranalysis.spatial.box.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).
    void checkMisconfigured​(org.anchoranalysis.bean.BeanInstanceMap defaultInstances)
    Checks if the bean is misconfigured and saves the default instances for later use.
    abstract org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<T> createFeatures​(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>> featuresSingleObject, org.anchoranalysis.feature.store.NamedFeatureStoreFactory storeFactory, boolean suppressErrors)
    Creates features that will be applied on the objects.
    ListWithThumbnails<T,​org.anchoranalysis.image.voxel.object.ObjectCollection> deriveInputsStartBatch​(org.anchoranalysis.image.voxel.object.ObjectCollection objects, org.anchoranalysis.feature.energy.EnergyStack energyStack, boolean thumbnailsEnabled, org.anchoranalysis.core.time.OperationContext context)
    Derives a list of inputs (i.e.
    org.anchoranalysis.image.bean.interpolator.Interpolator getInterpolator()
    Interpolator used to resize images in thumbnail generation.
    ThumbnailFromObjects getThumbnail()
    Generates a thumbnail representation of one or more combined objects, as form a single input.
    abstract org.anchoranalysis.image.voxel.object.ObjectCollection objectsForThumbnail​(T input)
    Selects objects from an input that will be used for thumbnail generation.
    void setInterpolator​(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)
    Interpolator used to resize images in thumbnail generation.
    void setThumbnail​(ThumbnailFromObjects thumbnail)
    Generates a thumbnail representation of one or more combined objects, as form a single input.
    protected abstract List<T> startBatchDeriveInputs​(org.anchoranalysis.image.voxel.object.ObjectCollection objects, org.anchoranalysis.feature.energy.EnergyStack energyStack, org.anchoranalysis.core.log.Logger logger)
    Derives a list of inputs from an object-collection.
    abstract String uniqueIdentifierFor​(T input)
    Generates a unique identifier for a particular input.

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

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

    • CombineObjectsForFeatures

      protected CombineObjectsForFeatures​(org.anchoranalysis.image.bean.interpolator.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​(org.anchoranalysis.bean.BeanInstanceMap defaultInstances) throws org.anchoranalysis.bean.exception.BeanMisconfiguredException
      Checks if the bean is misconfigured and saves the default instances for later use.
      Overrides:
      checkMisconfigured in class org.anchoranalysis.bean.AnchorBean<CombineObjectsForFeatures<T extends org.anchoranalysis.feature.input.FeatureInput>>
      Parameters:
      defaultInstances - the BeanInstanceMap containing default instances
      Throws:
      org.anchoranalysis.bean.exception.BeanMisconfiguredException - if the bean is misconfigured
    • createFeatures

      public abstract org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<T> createFeatures​(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>> featuresSingleObject, org.anchoranalysis.feature.store.NamedFeatureStoreFactory storeFactory, boolean suppressErrors) throws org.anchoranalysis.core.exception.CreateException, org.anchoranalysis.core.exception.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:
      org.anchoranalysis.core.exception.CreateException - if there's an error creating the features.
      org.anchoranalysis.core.exception.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,​org.anchoranalysis.image.voxel.object.ObjectCollection> deriveInputsStartBatch​(org.anchoranalysis.image.voxel.object.ObjectCollection objects, org.anchoranalysis.feature.energy.EnergyStack energyStack, boolean thumbnailsEnabled, org.anchoranalysis.core.time.OperationContext context) throws org.anchoranalysis.core.exception.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:
      org.anchoranalysis.core.exception.CreateException - if an error occurs deriving or creating the thumbnails.
    • objectsForThumbnail

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

      protected abstract List<T> startBatchDeriveInputs​(org.anchoranalysis.image.voxel.object.ObjectCollection objects, org.anchoranalysis.feature.energy.EnergyStack energyStack, org.anchoranalysis.core.log.Logger logger) throws org.anchoranalysis.core.exception.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:
      org.anchoranalysis.core.exception.CreateException - if there's an error deriving the inputs
    • boundingBoxThatSpansInput

      protected abstract org.anchoranalysis.spatial.box.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 org.anchoranalysis.image.bean.interpolator.Interpolator getInterpolator()
      Interpolator used to resize images in thumbnail generation.
    • setInterpolator

      public void setInterpolator​(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)
      Interpolator used to resize images in thumbnail generation.