Class MorphologicalErosion
Object
MorphologicalErosion
Performs morphological erosion operation on an
ObjectMask or BinaryVoxels.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic BinaryVoxels<UnsignedByteBuffer> erode(BinaryVoxels<UnsignedByteBuffer> voxels, int iterations, boolean useZ, Optional<Predicate<Point3i>> precondition) Performs a morphological erosion on aBinaryVoxels<UnsignedByteBuffer> voxels.static ObjectMaskerode(ObjectMask object, int iterations, boolean useZ) Performs a morphological erosion on anObjectMask.static ObjectMaskerode(ObjectMask object, int iterations, boolean useZ, Optional<AcceptIterationPredicate> postcondition) Performs a morphological erosion on anObjectMask- with a postcondition.
-
Method Details
-
erode
public static ObjectMask erode(ObjectMask object, int iterations, boolean useZ) throws CreateException Performs a morphological erosion on anObjectMask.- Parameters:
object- the object-mask to perform the erosion on.iterations- how many iterations of erosion to perform.useZ- whether to use the Z dimension or not during the erosion.- Returns:
- a newly created
BinaryVoxels<UnsignedByteBuffer>showingvoxelsafter the erosion operation was applied. - Throws:
CreateException
-
erode
public static ObjectMask erode(ObjectMask object, int iterations, boolean useZ, Optional<AcceptIterationPredicate> postcondition) throws CreateException Performs a morphological erosion on anObjectMask- with a postcondition.- Parameters:
object- the object-mask to perform the erosion on.iterations- how many iterations of erosion to perform.useZ- whether to use the Z dimension or not during the erosionpostcondition- conditions applied after each iteration of the erosion, otherwise no more iterations occur. Note that these are applied on an inverted version ofvoxels.- Returns:
- a newly created
BinaryVoxels<UnsignedByteBuffer>showingvoxelsafter the erosion operation was applied. - Throws:
CreateException
-
erode
public static BinaryVoxels<UnsignedByteBuffer> erode(BinaryVoxels<UnsignedByteBuffer> voxels, int iterations, boolean useZ, Optional<Predicate<Point3i>> precondition) throws CreateException Performs a morphological erosion on aBinaryVoxels<UnsignedByteBuffer> voxels.- Parameters:
voxels- the voxels to perform the erosion on.iterations- how many iterations of erosion to perform.useZ- whether to use the Z dimension or not during the erosion.precondition- if defined, a condition which must be satisfied on a voxel, before any voxel can be dilated.- Returns:
- a newly created
BinaryVoxels<UnsignedByteBuffer>showingvoxelsafter the erosion operation was applied. - Throws:
CreateException
-