Class MorphologicalErosion

Object
MorphologicalErosion

public class MorphologicalErosion extends Object
Performs morphological erosion operation on an ObjectMask or BinaryVoxels.
Author:
Owen Feehan
  • Method Details

    • erode

      public static ObjectMask erode(ObjectMask object, int iterations, boolean useZ) throws CreateException
      Performs a morphological erosion on an ObjectMask.
      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> showing voxels after 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 an ObjectMask - 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 erosion
      postcondition - conditions applied after each iteration of the erosion, otherwise no more iterations occur. Note that these are applied on an inverted version of voxels.
      Returns:
      a newly created BinaryVoxels<UnsignedByteBuffer> showing voxels after 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 a BinaryVoxels<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> showing voxels after the erosion operation was applied.
      Throws:
      CreateException