Class IterateVoxelsObjectMaskOptional

Object
IterateVoxelsObjectMaskOptional

public class IterateVoxelsObjectMaskOptional extends Object
Utilities for iterating over the subset of voxels corresponding to an on state in an optional ObjectMask.

If the ObjectMask is not defined, then all voxels are iterated over.

The utilities operate on one or more Voxels. A processor is called on each selected voxel.

Author:
Owen Feehan
  • Method Details

    • withPoint

      public static void withPoint(Optional<ObjectMask> objectMask, Extent extent, ProcessPoint process)
      Iterate over all points that are located on a object-mask or else all points in an extent.
      Parameters:
      objectMask - an optional object-mask that is used as a condition on what voxels to iterate. If not defined, all voxels are iterated over.
      extent - if object-mask isn't defined, then all the voxels in this Extent are iterated over instead
      process - process is called for each voxel (on the entire Extent or on the object-mask depending) using global coordinates.
    • withBuffer

      public static <T> void withBuffer(Optional<ObjectMask> objectMask, Voxels<T> voxels, ProcessBufferUnary<T> process)
      Iterate over each voxel (or optionally only on object-mask) with one associated buffer.
      Type Parameters:
      T - buffer-type for voxels
      Parameters:
      objectMask - an optional object-mask that is used as a condition on what voxels to iterate. If not defined, all voxels are iterated over.
      voxels - voxels where buffers extracted from be processed, and which define the global coordinate space
      process - is called for each voxel within the bounding-box using global coordinates.
    • withTwoBuffers

      public static <S, T> void withTwoBuffers(Optional<ObjectMask> objectMask, Voxels<S> voxels1, Voxels<T> voxels2, ProcessBufferBinary<S,T> process)
      Iterate over each voxel (or optionally only on object-mask) with two associated buffers.
      Type Parameters:
      T - buffer-type for voxels
      Parameters:
      objectMask - an optional object-mask that is used as a condition on what voxels to iterate. If not defined, all voxels are iterated over.
      voxels1 - voxels that provide the first voxel-buffer
      voxels2 - voxels that provide the second buffer
      process - is called for each voxel within the bounding-box using global coordinates.
    • withSlidingBuffer

      public static void withSlidingBuffer(Optional<ObjectMask> objectMask, SlidingBuffer<?> buffer, ProcessPoint process)
      Iterate over each voxel in a sliding-buffer, optionally restricting it to be only voxels in a certain object
      Parameters:
      objectMask - an optional object-mask that is used as a condition on what voxels to iterate
      buffer - a sliding-buffer whose voxels are iterated over, partially (if an objectmask is defined) or as a whole (if no onject-mask is defined)
      process - process is called for each voxel (on the entire SlidingBuffer or on the object-mask depending) using global coordinates.