Class VoxelsThresholder

Object
VoxelsThresholder

public class VoxelsThresholder extends Object
Performs a thresholding operation on voxels.

An on voxel is placed in the output-buffer if voxel-value >= level or off otherwise.

  • Method Details

    • thresholdByte

      public static void thresholdByte(Voxels<UnsignedByteBuffer> voxels, int level, BinaryValuesByte binaryValues)
      Applies thresholding to Voxels of unsigned byte data type.
      Parameters:
      voxels - the voxels, which are consumed, and replaced with on and off values.
      level - the level for thresholding, see the class description.
      binaryValues - how to encode the on and off states for the thresholding output.
    • thresholdFloat

      public static BinaryVoxels<UnsignedByteBuffer> thresholdFloat(Voxels<FloatBuffer> voxels, float level, BinaryValuesByte binaryValues)
      Applies thresholding to Voxels of float data type.
      Parameters:
      voxels - the voxels, which are left unchanged.
      level - the level for thresholding, see the class description.
      binaryValues - how to encode the on and off states for the thresholding output.
      Returns:
      a newly created BinaryVoxels, of identical size to voxels containing the output of the thresholding.
    • threshold

      public static BinaryVoxels<UnsignedByteBuffer> threshold(VoxelsUntyped voxels, float level, BinaryValuesByte binaryValues, Optional<ObjectMask> objectMask, boolean alwaysDuplicate) throws OperationFailedException
      Applies thresholding to VoxelsUntyped.

      Only unsigned byte float data types are supported.

      Parameters:
      voxels - the voxels, which are always unchanged if alwaysDuplicate is true, and otherwise will be changed if they are of unsigned byte type.
      level - the level for thresholding, see the class description.
      binaryValues - how to encode the on and off states for the thresholding output.
      objectMask - if set, restricts the region where thresholding occurs to correspond to this object-mask.
      alwaysDuplicate - if true, voxels are never reused in the output, with new buffers always created.
      Returns:
      a BinaryVoxels, reusing voxels if they are of type unsigned byte (and alwaysDuplicate is false), otherwise created newly.
      Throws:
      OperationFailedException - if an unsupported data-type exists in voxels.