Class PairNeighbors
Object
AnchorBean<CombineObjectsForFeatures<FeatureInputPairObjects>>
CombineObjectsForFeatures<FeatureInputPairObjects>
PairNeighbors
Creates a set of features, that creates pairs of neighboring-objects and applies a mixture of
single-object features and pair features.
Specifically:
- Creates a graph of neighboring-objects.
- Passes each pair of immediately-neighboring objects, together with their merged object, as an input.
Features are formed by duplicating the input-feature list (inputfeatures, single-object features only):
a) First.inputfeatures applies the features to the first-object in the pair b) Second.inputfeatures applies the features to the second-object in the pair c) Merged.inputfeatures applies the features to the merged-object
Features (that are not duplicated) are also possible:
d) Image. additional single-object features that don't depend on any individual-object, only the image
e) Pair. additional pair-features (FeatureInputPairObjects)
The column order output is: Image, First, Second, Pair, Merged
For First and Second, we use a cache, to avoid repeated
calculations.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BoundingBoxboundingBoxThatSpansInput(FeatureInputPairObjects input) Creates a bounding-box that tightly fits the input to a particular table row (could be for one or more objects).FeatureTableCalculator<FeatureInputPairObjects> createFeatures(List<NamedBean<FeatureListProvider<FeatureInputSingleObject>>> list, NamedFeatureStoreFactory storeFactory, boolean suppressErrors) Creates features that will be applied on the objects.List<NamedBean<FeatureListProvider<FeatureInputStack>>> Additional features that only depend on the image, so do not need to be replicated for every object.List<NamedBean<FeatureListProvider<FeatureInputPairObjects>>> Additional features that are processed on the pair of images (i.e.booleanIf true, no overlapping objects are treated as pairsbooleanisDo3D()booleanInclude features for the First-object of the pairbooleanInclude features for the Merged-object of the pairbooleanInclude features for the Second-object of the pairObjectCollectionobjectsForThumbnail(FeatureInputPairObjects input) Selects objects from an input that will be used for thumbnail generation.voidsetAvoidOverlappingObjects(boolean avoidOverlappingObjects) If true, no overlapping objects are treated as pairsvoidsetDo3D(boolean do3D) voidsetFeaturesImage(List<NamedBean<FeatureListProvider<FeatureInputStack>>> featuresImage) Additional features that only depend on the image, so do not need to be replicated for every object.voidsetFeaturesPair(List<NamedBean<FeatureListProvider<FeatureInputPairObjects>>> featuresPair) Additional features that are processed on the pair of images (i.e.voidsetIncludeFirst(boolean includeFirst) Include features for the First-object of the pairvoidsetIncludeMerged(boolean includeMerged) Include features for the Merged-object of the pairvoidsetIncludeSecond(boolean includeSecond) Include features for the Second-object of the pairList<FeatureInputPairObjects> startBatchDeriveInputs(ObjectCollection objects, EnergyStack energyStack, Logger logger) Derives a list of inputs from an object-collection.uniqueIdentifierFor(FeatureInputPairObjects input) Generates a unique identifier for a particular input.Methods inherited from class org.anchoranalysis.plugin.image.feature.bean.object.combine.CombineObjectsForFeatures
checkMisconfigured, deriveInputsStartBatch, getInterpolator, getThumbnail, setInterpolator, setThumbnailMethods inherited from class org.anchoranalysis.bean.AnchorBean
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
PairNeighbors
public PairNeighbors()
-
-
Method Details
-
createFeatures
public FeatureTableCalculator<FeatureInputPairObjects> createFeatures(List<NamedBean<FeatureListProvider<FeatureInputSingleObject>>> list, NamedFeatureStoreFactory storeFactory, boolean suppressErrors) throws CreateException Description copied from class:CombineObjectsForFeaturesCreates features that will be applied on the objects. Features should always be duplicated from the input list.- Specified by:
createFeaturesin classCombineObjectsForFeatures<FeatureInputPairObjects>- Parameters:
list- 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:
CreateException- if there's an error creating the features.
-
startBatchDeriveInputs
public List<FeatureInputPairObjects> startBatchDeriveInputs(ObjectCollection objects, EnergyStack energyStack, Logger logger) throws CreateException Description copied from class:CombineObjectsForFeaturesDerives a list of inputs from an object-collection.- Specified by:
startBatchDeriveInputsin classCombineObjectsForFeatures<FeatureInputPairObjects>- Parameters:
objects- the object-collectionenergyStack- energy-stack used during feature calculationlogger- the logger- Returns:
- the list of inputs
- Throws:
CreateException- if there's an error deriving the inputs
-
uniqueIdentifierFor
Description copied from class:CombineObjectsForFeaturesGenerates a unique identifier for a particular input.- Specified by:
uniqueIdentifierForin classCombineObjectsForFeatures<FeatureInputPairObjects>- Parameters:
input- the input to generate a unique identifier for- Returns:
- a unique identifier string
-
objectsForThumbnail
public ObjectCollection objectsForThumbnail(FeatureInputPairObjects input) throws CreateException Description copied from class:CombineObjectsForFeaturesSelects objects from an input that will be used for thumbnail generation.- Specified by:
objectsForThumbnailin classCombineObjectsForFeatures<FeatureInputPairObjects>- Parameters:
input- the input- Returns:
- the
ObjectCollectionfor thumbnail generation - Throws:
CreateException- if there's an error creating the object collection
-
boundingBoxThatSpansInput
protected BoundingBox boundingBoxThatSpansInput(FeatureInputPairObjects input) Description copied from class:CombineObjectsForFeaturesCreates a bounding-box that tightly fits the input to a particular table row (could be for one or more objects).- Specified by:
boundingBoxThatSpansInputin classCombineObjectsForFeatures<FeatureInputPairObjects>- Parameters:
input- the input- Returns:
- a
BoundingBoxthat fully fits around all objects used in input
-
getFeaturesPair
Additional features that are processed on the pair of images (i.e. First+Second as a pair) -
setFeaturesPair
public void setFeaturesPair(List<NamedBean<FeatureListProvider<FeatureInputPairObjects>>> featuresPair) Additional features that are processed on the pair of images (i.e. First+Second as a pair) -
getFeaturesImage
Additional features that only depend on the image, so do not need to be replicated for every object. -
setFeaturesImage
Additional features that only depend on the image, so do not need to be replicated for every object. -
isIncludeFirst
public boolean isIncludeFirst()Include features for the First-object of the pair -
setIncludeFirst
public void setIncludeFirst(boolean includeFirst) Include features for the First-object of the pair -
isIncludeSecond
public boolean isIncludeSecond()Include features for the Second-object of the pair -
setIncludeSecond
public void setIncludeSecond(boolean includeSecond) Include features for the Second-object of the pair -
isIncludeMerged
public boolean isIncludeMerged()Include features for the Merged-object of the pair -
setIncludeMerged
public void setIncludeMerged(boolean includeMerged) Include features for the Merged-object of the pair -
isAvoidOverlappingObjects
public boolean isAvoidOverlappingObjects()If true, no overlapping objects are treated as pairs -
setAvoidOverlappingObjects
public void setAvoidOverlappingObjects(boolean avoidOverlappingObjects) If true, no overlapping objects are treated as pairs -
isDo3D
public boolean isDo3D() -
setDo3D
public void setDo3D(boolean do3D)
-