Class IterateVoxelsMask

Object
IterateVoxelsMask

public class IterateVoxelsMask extends Object
Utilities for iterating over the subset of voxels corresponding to an on state in a Mask.

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

Author:
Owen Feehan
  • Method Details

    • withBuffer

      public static <T> void withBuffer(Mask mask, Voxels<T> voxels, ProcessBufferUnary<T> process)
      Iterate over each voxel in a mask - with an associated buffer for each slice from a voxel-bo
      Type Parameters:
      T - buffer-type for voxels
      Parameters:
      mask - the mask is used as a condition on what voxels to iterate i.e. only voxels within these bounds
      voxels - voxels to iterate over (if the corresponding mask voxel is on)
      process - is called for each voxel within the bounding-box using global coordinates.
    • calculateRunningSum

      public static RunningSum calculateRunningSum(Mask mask, Voxels<UnsignedByteBuffer> voxelsIntensity)
      Calculates the sum and count across voxels intensity that correspond to on voxels on a mask

      The mask must have equal extent to voxelsIntensity

      Parameters:
      mask - only voxels who correspond to an on voxels in the mask are included
      voxelsIntensity - the voxels whose intensity we wish to find the mean of (subject to mask
      Returns:
      the running-sum