Class MergeBase
- All Implemented Interfaces:
Provider<ObjectCollection>
- Direct Known Subclasses:
MergeWithOptionalDistanceConstraint
A base class for algorithms that merge object-masks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
Functional interface for merging objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvider for image dimensions.protected ObjectCollection
mergeMultiplex
(ObjectCollection objects, MergeBase.MergeObjects mergeFunc) Merges objects either in a container or altogether.protected Resolution
Gets the requiredResolution
.void
setDimensions
(DimensionsProvider dimensions) Provider for image dimensions.protected Optional
<UnitConverter> Gets an optionalUnitConverter
based on the image resolution.Methods inherited from class org.anchoranalysis.plugin.image.bean.object.provider.WithContainerBase
containerOptional, containerRequired, getObjectsContainer, setObjectsContainer
Methods inherited from class org.anchoranalysis.image.bean.provider.ObjectCollectionProviderUnary
createFromObjects, get, getObjects, setObjects
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
MergeBase
public MergeBase()
-
-
Method Details
-
unitConvertOptional
Gets an optionalUnitConverter
based on the image resolution.- Returns:
- an
Optional
containing aUnitConverter
if resolution is available, empty otherwise - Throws:
OperationFailedException
- if retrieving the resolution fails
-
resolutionRequired
Gets the requiredResolution
.- Returns:
- the
Resolution
- Throws:
OperationFailedException
- if the resolution is not available
-
mergeMultiplex
protected ObjectCollection mergeMultiplex(ObjectCollection objects, MergeBase.MergeObjects mergeFunc) throws OperationFailedException Merges objects either in a container or altogether.- Parameters:
objects
- theObjectCollection
to mergemergeFunc
- a function that merges a collection of objects together (changes the collection in place)- Returns:
- the merged
ObjectCollection
- Throws:
OperationFailedException
- if the merge operation fails
-
getDimensions
Provider for image dimensions. -
setDimensions
Provider for image dimensions.
-