Class FillHoles

Object
AnchorBean<MaskProvider>
InitializableBean<MaskProvider, ImageInitialization>
ImageBean<MaskProvider>
BeanProviderAsStackBase<MaskProvider, Mask>
MaskProvider
MaskProviderUnary
FillHoles
All Implemented Interfaces:
Provider<Mask>, ProviderAsStack

public class FillHoles extends MaskProviderUnary
Fills holes in a mask, with options to skip holes touching the border or exceeding a maximum volume.

This class extends MaskProviderUnary to provide functionality for filling holes in binary masks.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Mask
    createFromMask(Mask mask)
     
    UnitValueExtent
    The maximum volume of a hole to be filled.
    boolean
    If true, holes that touch the border of the mask are not filled.
    void
    setMaxVolume(UnitValueExtent maxVolume)
    The maximum volume of a hole to be filled.
    void
    setSkipAtBorder(boolean skipAtBorder)
    If true, holes that touch the border of the mask are not filled.

    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

    • FillHoles

      public FillHoles()
  • Method Details

    • createFromMask

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

      public UnitValueExtent getMaxVolume()
      The maximum volume of a hole to be filled. If null, no maximum volume constraint is applied.
    • setMaxVolume

      public void setMaxVolume(UnitValueExtent maxVolume)
      The maximum volume of a hole to be filled. If null, no maximum volume constraint is applied.
    • isSkipAtBorder

      public boolean isSkipAtBorder()
      If true, holes that touch the border of the mask are not filled. Default value is true.
    • setSkipAtBorder

      public void setSkipAtBorder(boolean skipAtBorder)
      If true, holes that touch the border of the mask are not filled. Default value is true.