Class MorphologicalOperatorBase

Object
AnchorBean<MaskProvider>
InitializableBean<MaskProvider, ImageInitialization>
ImageBean<MaskProvider>
BeanProviderAsStackBase<MaskProvider, Mask>
MaskProvider
MaskProviderUnary
MorphologicalOperatorBase
All Implemented Interfaces:
Provider<Mask>, ProviderAsStack
Direct Known Subclasses:
Dilate, Erode

public abstract class MorphologicalOperatorBase extends MaskProviderUnary
Base class for performing morphological operations on BinaryVoxels.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    applyMorphologicalOperation(Mask source, boolean do3D)
    Applies the morphological operation to the source mask.
    Mask
    createFromMask(Mask mask)
     
    ChannelProvider
    Optional provider for a background channel to use in intensity-based conditions.
    int
    Number of iterations to apply the morphological operation.
    int
    Minimum intensity value for voxels to be considered in the operation.
    boolean
    Whether to suppress 3D operations and only perform 2D operations.
    protected Optional<Predicate<Point3i>>
    Creates a precondition for the morphological operation based on intensity values.
    void
    setBackgroundChannelProvider(ChannelProvider backgroundChannelProvider)
    Optional provider for a background channel to use in intensity-based conditions.
    void
    setIterations(int iterations)
    Number of iterations to apply the morphological operation.
    void
    setMinIntensityValue(int minIntensityValue)
    Minimum intensity value for voxels to be considered in the operation.
    void
    setSuppress3D(boolean suppress3D)
    Whether to suppress 3D operations and only perform 2D operations.

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

    get, getMask, setMask

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

    getAsStack

    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

    • MorphologicalOperatorBase

      public MorphologicalOperatorBase()
  • Method Details

    • applyMorphologicalOperation

      protected abstract void applyMorphologicalOperation(Mask source, boolean do3D) throws ProvisionFailedException
      Applies the morphological operation to the source mask.
      Parameters:
      source - the source mask to apply the operation to
      do3D - whether to perform the operation in 3D
      Throws:
      ProvisionFailedException - if the operation fails
    • createFromMask

      public Mask createFromMask(Mask mask) throws ProvisionFailedException
      Specified by:
      createFromMask in class MaskProviderUnary
      Throws:
      ProvisionFailedException
    • precondition

      protected Optional<Predicate<Point3i>> precondition() throws ProvisionFailedException
      Creates a precondition for the morphological operation based on intensity values.
      Returns:
      an optional predicate that checks if a voxel meets the intensity condition
      Throws:
      ProvisionFailedException - if creating the precondition fails
    • getBackgroundChannelProvider

      public ChannelProvider getBackgroundChannelProvider()
      Optional provider for a background channel to use in intensity-based conditions.
    • setBackgroundChannelProvider

      public void setBackgroundChannelProvider(ChannelProvider backgroundChannelProvider)
      Optional provider for a background channel to use in intensity-based conditions.
    • getIterations

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

      public void setIterations(int iterations)
      Number of iterations to apply the morphological operation.
    • getMinIntensityValue

      public int getMinIntensityValue()
      Minimum intensity value for voxels to be considered in the operation.
    • setMinIntensityValue

      public void setMinIntensityValue(int minIntensityValue)
      Minimum intensity value for voxels to be considered in the operation.
    • isSuppress3D

      public boolean isSuppress3D()
      Whether to suppress 3D operations and only perform 2D operations.
    • setSuppress3D

      public void setSuppress3D(boolean suppress3D)
      Whether to suppress 3D operations and only perform 2D operations.