Class MergeBase

Object
AnchorBean<ObjectCollectionProvider>
InitializableBean<ObjectCollectionProvider, ImageInitialization>
ImageBean<ObjectCollectionProvider>
ObjectCollectionProvider
ObjectCollectionProviderUnary
All Implemented Interfaces:
Provider<ObjectCollection>
Direct Known Subclasses:
MergeWithOptionalDistanceConstraint

public abstract class MergeBase extends WithContainerBase
A base class for algorithms that merge object-masks.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static interface 
    Functional interface for merging objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    DimensionsProvider
    Provider for image dimensions.
    protected ObjectCollection
    mergeMultiplex(ObjectCollection objects, MergeBase.MergeObjects mergeFunc)
    Merges objects either in a container or altogether.
    protected Resolution
    Gets the required Resolution.
    void
    setDimensions(DimensionsProvider dimensions)
    Provider for image dimensions.
    protected Optional<UnitConverter>
    Gets an optional UnitConverter 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MergeBase

      public MergeBase()
  • Method Details

    • unitConvertOptional

      protected Optional<UnitConverter> unitConvertOptional() throws OperationFailedException
      Gets an optional UnitConverter based on the image resolution.
      Returns:
      an Optional containing a UnitConverter if resolution is available, empty otherwise
      Throws:
      OperationFailedException - if retrieving the resolution fails
    • resolutionRequired

      protected Resolution resolutionRequired() throws OperationFailedException
      Gets the required Resolution.
      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 - the ObjectCollection to merge
      mergeFunc - 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

      public DimensionsProvider getDimensions()
      Provider for image dimensions.
    • setDimensions

      public void setDimensions(DimensionsProvider dimensions)
      Provider for image dimensions.