Class FillHoles
- All Implemented Interfaces:
Provider<Mask>
,ProviderAsStack
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 -
Method Summary
Modifier and TypeMethodDescriptioncreateFromMask
(Mask mask) Creates aMask
given the entity provided by the delegate.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
-
Constructor Details
-
FillHoles
public FillHoles()
-
-
Method Details
-
createFromMask
Description copied from class:MaskProviderUnary
Creates aMask
given the entity provided by the delegate.- Specified by:
createFromMask
in classMaskProviderUnary
- Parameters:
mask
- the entity provided by the delegate.- Returns:
- the created
Mask
that is returned by the provider. - Throws:
ProvisionFailedException
- if the provider cannot complete successfully.
-
getMaxVolume
The maximum volume of a hole to be filled. If null, no maximum volume constraint is applied. -
setMaxVolume
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.
-