Class PairNeighbors
Object
org.anchoranalysis.bean.AnchorBean<CombineObjectsForFeatures<T>>
org.anchoranalysis.plugin.image.feature.bean.object.combine.CombineObjectsForFeatures<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>
org.anchoranalysis.plugin.image.feature.bean.object.combine.PairNeighbors
public class PairNeighbors extends CombineObjectsForFeatures<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>
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 Constructor Description PairNeighbors() -
Method Summary
Modifier and Type Method Description protected org.anchoranalysis.spatial.box.BoundingBoxboundingBoxThatSpansInput(org.anchoranalysis.image.feature.input.FeatureInputPairObjects input)Creates a bounding-box that tightly fits the input to a particular table row (could be for one or more objects).org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>createFeatures(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>> list, org.anchoranalysis.feature.store.NamedFeatureStoreFactory storeFactory, boolean suppressErrors)Creates features that will be applied on the objects.List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputStack>>>getFeaturesImage()Additional features that only depend on the image, so do not need to be replicated for every object.List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>>>getFeaturesPair()Additional features that are processed on the pair of images (i.e.booleanisAvoidOverlappingObjects()If true, no overlapping objects are treated as pairsbooleanisDo3D()booleanisIncludeFirst()Include features for the First-object of the pairbooleanisIncludeMerged()Include features for the Merged-object of the pairbooleanisIncludeSecond()Include features for the Second-object of the pairorg.anchoranalysis.image.voxel.object.ObjectCollectionobjectsForThumbnail(org.anchoranalysis.image.feature.input.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<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputStack>>> featuresImage)Additional features that only depend on the image, so do not need to be replicated for every object.voidsetFeaturesPair(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.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<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>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.StringuniqueIdentifierFor(org.anchoranalysis.image.feature.input.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, setThumbnail
-
Constructor Details
-
PairNeighbors
public PairNeighbors()
-
-
Method Details
-
createFeatures
public org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<org.anchoranalysis.image.feature.input.FeatureInputPairObjects> createFeatures(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>> list, org.anchoranalysis.feature.store.NamedFeatureStoreFactory storeFactory, boolean suppressErrors) throws org.anchoranalysis.core.exception.CreateExceptionDescription 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<org.anchoranalysis.image.feature.input.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:
org.anchoranalysis.core.exception.CreateException- if there's an error creating the features.
-
startBatchDeriveInputs
public List<org.anchoranalysis.image.feature.input.FeatureInputPairObjects> 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.CreateExceptionDescription copied from class:CombineObjectsForFeaturesDerives a list of inputs from an object-collection.- Specified by:
startBatchDeriveInputsin classCombineObjectsForFeatures<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>- 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
-
uniqueIdentifierFor
public String uniqueIdentifierFor(org.anchoranalysis.image.feature.input.FeatureInputPairObjects input)Description copied from class:CombineObjectsForFeaturesGenerates a unique identifier for a particular input.- Specified by:
uniqueIdentifierForin classCombineObjectsForFeatures<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>- Parameters:
input- the input to generate a unique identifier for- Returns:
- a unique identifier string
-
objectsForThumbnail
public org.anchoranalysis.image.voxel.object.ObjectCollection objectsForThumbnail(org.anchoranalysis.image.feature.input.FeatureInputPairObjects input) throws org.anchoranalysis.core.exception.CreateExceptionDescription copied from class:CombineObjectsForFeaturesSelects objects from an input that will be used for thumbnail generation.- Specified by:
objectsForThumbnailin classCombineObjectsForFeatures<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>- Parameters:
input- the input- Returns:
- the
ObjectCollectionfor thumbnail generation - Throws:
org.anchoranalysis.core.exception.CreateException- if there's an error creating the object collection
-
boundingBoxThatSpansInput
protected org.anchoranalysis.spatial.box.BoundingBox boundingBoxThatSpansInput(org.anchoranalysis.image.feature.input.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<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>- Parameters:
input- the input- Returns:
- a
BoundingBoxthat fully fits around all objects used in input
-
getFeaturesPair
public List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>>> getFeaturesPair()Additional features that are processed on the pair of images (i.e. First+Second as a pair) -
setFeaturesPair
public void setFeaturesPair(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputPairObjects>>> featuresPair)Additional features that are processed on the pair of images (i.e. First+Second as a pair) -
getFeaturesImage
public List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputStack>>> getFeaturesImage()Additional features that only depend on the image, so do not need to be replicated for every object. -
setFeaturesImage
public void setFeaturesImage(List<org.anchoranalysis.bean.NamedBean<org.anchoranalysis.feature.bean.list.FeatureListProvider<org.anchoranalysis.image.feature.input.FeatureInputStack>>> featuresImage)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)
-