Class MorphologicalOperatorBase
Object
AnchorBean<MaskProvider>
InitializableBean<MaskProvider, ImageInitialization>
ImageBean<MaskProvider>
BeanProviderAsStackBase<MaskProvider, Mask>
MaskProvider
MaskProviderUnary
MorphologicalOperatorBase
- All Implemented Interfaces:
Provider<Mask>,ProviderAsStack
public abstract class MorphologicalOperatorBase
extends MaskProviderUnary
Base class for performing morphological operations on
BinaryVoxels.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidapplyMorphologicalOperation(Mask source, boolean do3D) Applies the morphological operation to the source mask.MaskcreateFromMask(Mask mask) ChannelProviderOptional provider for a background channel to use in intensity-based conditions.intNumber of iterations to apply the morphological operation.intMinimum intensity value for voxels to be considered in the operation.booleanWhether to suppress 3D operations and only perform 2D operations.Creates a precondition for the morphological operation based on intensity values.voidsetBackgroundChannelProvider(ChannelProvider backgroundChannelProvider) Optional provider for a background channel to use in intensity-based conditions.voidsetIterations(int iterations) Number of iterations to apply the morphological operation.voidsetMinIntensityValue(int minIntensityValue) Minimum intensity value for voxels to be considered in the operation.voidsetSuppress3D(boolean suppress3D) Whether to suppress 3D operations and only perform 2D operations.Methods inherited from class org.anchoranalysis.image.bean.provider.MaskProviderUnary
get, getMask, setMaskMethods inherited from class org.anchoranalysis.image.bean.provider.MaskProvider
getAsStackMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
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 todo3D- whether to perform the operation in 3D- Throws:
ProvisionFailedException- if the operation fails
-
createFromMask
public Mask createFromMask(Mask mask) throws ProvisionFailedException - Specified by:
createFromMaskin classMaskProviderUnary- Throws:
ProvisionFailedException
-
precondition
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.
-