Class BinaryKernelMorphological

Object
Kernel
BinaryKernel
BinaryKernelMorphological
Direct Known Subclasses:
DilationKernel, ErosionKernel, OutlineKernelBase

public abstract class BinaryKernelMorphological extends BinaryKernel
A parent class for any BinaryKernel that implements a morphological operation.
Author:
Owen Feehan
  • Constructor Details

    • BinaryKernelMorphological

      protected BinaryKernelMorphological(boolean bigNeighborhood, boolean unqualifiedOutcome, boolean failedFirstCheckOutcome)
      Creates with a flag for big-neighborhood, and boolean outcomes for certain cases.
      Parameters:
      bigNeighborhood - if true, a big neighborhood is used 2D-plane (8-connected instead of 4-connected), but not in Z-direction (remains always 2-connected).
      unqualifiedOutcome - the (negative) outcome that occurs if no neighbor qualifies (satisfies a condition). The positive outcome is assumed to be the complement of this.
      failedFirstCheckOutcome - if the first-check fails, this outcome is returned.
  • Method Details

    • notifyBuffer

      public void notifyBuffer(LocalSlices slices, int sliceIndex)
      Description copied from class: Kernel
      Called to inform the Kernel of buffers that are currently being processed.

      Only a single z-slice is processed at a particular time.

      This should be repeatedly called each time the focus changes to a different z-slice.

      Specified by:
      notifyBuffer in class Kernel
      Parameters:
      slices - slices that can be processed by the kernel, localized to a current local area of focus.
      sliceIndex - the global z-index of the slice that is currently the focus of the kernel.
    • calculateAt

      public boolean calculateAt(KernelPointCursor point)
      Description copied from class: BinaryKernel
      Calculates the boolean at a particular point.
      Specified by:
      calculateAt in class BinaryKernel
      Parameters:
      point - the point.
      Returns:
      the boolean result at this point.
    • firstCheck

      protected abstract boolean firstCheck(KernelPointCursor point, UnsignedByteBuffer buffer)
      The first check done on the kernel center-point, before checking any neighbors.
      Parameters:
      point - a kernel focused on a particular point.
      buffer - the associated buffer.
      Returns:
      true if the check passed, and false otherwise.
    • doesNeighborQualify

      protected abstract boolean doesNeighborQualify(boolean inside, KernelPointCursor point, Supplier<UnsignedByteBuffer> buffer, int zShift)
      Does a particular neighboring-point satisfy the conditions.
      Parameters:
      inside - true iff the neighboring-point is inside the scene.
      point - the point.
      buffer - the associated buffer.
      zShift - the buffer associated with the current point.
      Returns:
      true if the neighboring-point satisfied the conditions.