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()protectedCombineObjectsForFeatures(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.BoundingBoxboundingBoxThatSpansInput(T input)Creates a bounding-box that tightly fits the input to a particular table row (could be for one or more objects).voidcheckMisconfigured(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.InterpolatorgetInterpolator()Interpolator used to resize images in thumbnail generation.ThumbnailFromObjectsgetThumbnail()Generates a thumbnail representation of one or more combined objects, as form a single input.abstract org.anchoranalysis.image.voxel.object.ObjectCollectionobjectsForThumbnail(T input)Selects objects from an input that will be used for thumbnail generation.voidsetInterpolator(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)Interpolator used to resize images in thumbnail generation.voidsetThumbnail(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 StringuniqueIdentifierFor(T input)Generates a unique identifier for a particular input.
-
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.BeanMisconfiguredExceptionChecks if the bean is misconfigured and saves the default instances for later use.- Overrides:
checkMisconfiguredin classorg.anchoranalysis.bean.AnchorBean<CombineObjectsForFeatures<T extends org.anchoranalysis.feature.input.FeatureInput>>- Parameters:
defaultInstances- theBeanInstanceMapcontaining 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.InitializeExceptionCreates 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 newNamedFeatureStoreas needed.suppressErrors- when true, exceptions aren't thrown when feature-calculations fail, but rather a log error message is written.- Returns:
- a
FeatureTableCalculatorfor feature tables that may apply various features derived fromfeaturesSingleObject. - 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
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.CreateExceptionDerives 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.CreateExceptionSelects objects from an input that will be used for thumbnail generation.- Parameters:
input- the input- Returns:
- the
ObjectCollectionfor 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.CreateExceptionDerives a list of inputs from an object-collection.- Parameters:
objects- the object-collectionenergyStack- energy-stack used during feature calculationlogger- the logger- Returns:
- the list of inputs
- Throws:
org.anchoranalysis.core.exception.CreateException- if there's an error deriving the inputs
-
boundingBoxThatSpansInput
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
BoundingBoxthat fully fits around all objects used in input
-
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
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.
-