Class ObjectCollectionProviderMorphological
- All Implemented Interfaces:
Provider<ObjectCollection>
Base class for providers that apply morphological operations to an
ObjectCollection
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ObjectMask
applyMorphologicalOperation
(ObjectMask object, Optional<Extent> extent) Applies the morphological operation to a singleObjectMask
.createFromObjects
(ObjectCollection objects) Creates aObjectCollection
given the entity provided by the delegate.Derives the extent from the dimensions, if available.int
The number of iterations to apply the morphological operation.boolean
isDo3D()
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
-
Constructor Details
-
ObjectCollectionProviderMorphological
public ObjectCollectionProviderMorphological()
-
-
Method Details
-
createFromObjects
Description copied from class:ObjectCollectionProviderUnary
Creates aObjectCollection
given the entity provided by the delegate.- Specified by:
createFromObjects
in classObjectCollectionProviderUnary
- Parameters:
objects
- the entity provided by the delegate.- Returns:
- the created
ObjectCollection
that is returned by the provider. - Throws:
ProvisionFailedException
- if the provider cannot complete successfully.
-
applyMorphologicalOperation
protected abstract ObjectMask applyMorphologicalOperation(ObjectMask object, Optional<Extent> extent) throws ProvisionFailedException Applies the morphological operation to a singleObjectMask
.- Parameters:
object
- the object to apply the operation toextent
- optional extent to constrain the operation- Returns:
- the resulting object after applying the operation
- Throws:
ProvisionFailedException
- if the operation fails
-
deriveExtent
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.
-