Object
WalkPredicate

public class WalkPredicate extends Object
Walks in X, Y and Z directions from a point, test a NeighborPredicate to determine if a neighbor satisfies conditions.

As soon as any neighbor matches the predicate, a true value is returned for the voxel. A false is returned only if no neighbors match the predicate.

Author:
Owen Feehan
  • Constructor Details

    • WalkPredicate

      public WalkPredicate(KernelPointCursor point, NeighborPredicate predicate, boolean bigNeighborhood)
      Creates a new WalkPredicate instance.
      Parameters:
      point - The cursor used for iterating through points.
      predicate - Whether a neighbor qualifies or not.
      bigNeighborhood - Whether to use a big-neighborhood or not.

      if true, a big neighborhood is used 2D-plane (8-connected instead of 4-connected), but not in Z-direction (remains 2-connected).

  • Method Details

    • walk

      public boolean walk(UnsignedByteBuffer buffer, BufferRetriever bufferRetriever)
      Do any neighboring voxels in any direction satisfy the predicate?
      Parameters:
      buffer - the buffer associated with the current slice
      bufferRetriever - a means of retrieving buffers for other slices, accepting a relative shift compared to current slice (e.g. -1, +1) etc.
      Returns:
      true iff at least one neighbor voxel in any direction satisfies the predicate.