Class ObjectCollectionProviderMorphological

Object
AnchorBean<ObjectCollectionProvider>
InitializableBean<ObjectCollectionProvider, ImageInitialization>
ImageBean<ObjectCollectionProvider>
ObjectCollectionProvider
ObjectCollectionProviderUnary
WithOptionalDimensionsBase
ObjectCollectionProviderMorphological
All Implemented Interfaces:
Provider<ObjectCollection>
Direct Known Subclasses:
Dilate, Erode

public abstract class ObjectCollectionProviderMorphological extends WithOptionalDimensionsBase
Base class for providers that apply morphological operations to an ObjectCollection.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract ObjectMask
    applyMorphologicalOperation(ObjectMask object, Optional<Extent> extent)
    Applies the morphological operation to a single ObjectMask.
    ObjectCollection
    createFromObjects(ObjectCollection objects)
     
    protected Optional<Extent>
    Derives the extent from the dimensions, if available.
    int
    The number of iterations to apply the morphological operation.
    boolean
    Whether to perform the operation in 3D (true) or 2D (false).
    void
    setDo3D(boolean do3D)
    Whether to perform the operation in 3D (true) or 2D (false).
    void
    setIterations(int iterations)
    The number of iterations to apply the morphological operation.

    Methods inherited from class org.anchoranalysis.plugin.image.bean.object.provider.WithOptionalDimensionsBase

    createDims, getDimensions, setDimensions

    Methods inherited from class org.anchoranalysis.image.bean.provider.ObjectCollectionProviderUnary

    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

    • ObjectCollectionProviderMorphological

      public ObjectCollectionProviderMorphological()
  • Method Details

    • createFromObjects

      public ObjectCollection createFromObjects(ObjectCollection objects) throws ProvisionFailedException
      Specified by:
      createFromObjects in class ObjectCollectionProviderUnary
      Throws:
      ProvisionFailedException
    • applyMorphologicalOperation

      protected abstract ObjectMask applyMorphologicalOperation(ObjectMask object, Optional<Extent> extent) throws ProvisionFailedException
      Applies the morphological operation to a single ObjectMask.
      Parameters:
      object - the object to apply the operation to
      extent - optional extent to constrain the operation
      Returns:
      the resulting object after applying the operation
      Throws:
      ProvisionFailedException - if the operation fails
    • deriveExtent

      protected Optional<Extent> deriveExtent() throws ProvisionFailedException
      Derives the extent from the dimensions, if available.
      Returns:
      an optional extent derived from the dimensions
      Throws:
      ProvisionFailedException - if deriving the extent fails
    • isDo3D

      public boolean isDo3D()
      Whether to perform the operation in 3D (true) or 2D (false).
    • setDo3D

      public void setDo3D(boolean do3D)
      Whether to perform the operation in 3D (true) or 2D (false).
    • getIterations

      public int getIterations()
      The number of iterations to apply the morphological operation.
    • setIterations

      public void setIterations(int iterations)
      The number of iterations to apply the morphological operation.