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 interfaceFunctional interface for merging objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvider for image dimensions.protected ObjectCollectionmergeMultiplex(ObjectCollection objects, MergeBase.MergeObjects mergeFunc) Merges objects either in a container or altogether.protected ResolutionGets the requiredResolution.voidsetDimensions(DimensionsProvider dimensions) Provider for image dimensions.protected Optional<UnitConverter> Gets an optionalUnitConverterbased on the image resolution.Methods inherited from class org.anchoranalysis.plugin.image.bean.object.provider.WithContainerBase
containerOptional, containerRequired, getObjectsContainer, setObjectsContainerMethods inherited from class org.anchoranalysis.image.bean.provider.ObjectCollectionProviderUnary
createFromObjects, get, getObjects, setObjectsMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods 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 optionalUnitConverterbased on the image resolution.- Returns:
- an
Optionalcontaining aUnitConverterif 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- theObjectCollectionto 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.
-