Class VoxelsThresholder
Object
VoxelsThresholder
Performs a thresholding
operation on voxels.
An on voxel is placed in the output-buffer if voxel-value >= level or
off otherwise.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BinaryVoxels<UnsignedByteBuffer> threshold(VoxelsUntyped voxels, float level, BinaryValuesByte binaryValues, Optional<ObjectMask> objectMask, boolean alwaysDuplicate) Applies thresholding toVoxelsUntyped.static voidthresholdByte(Voxels<UnsignedByteBuffer> voxels, int level, BinaryValuesByte binaryValues) Applies thresholding toVoxelsof unsigned byte data type.static BinaryVoxels<UnsignedByteBuffer> thresholdFloat(Voxels<FloatBuffer> voxels, float level, BinaryValuesByte binaryValues) Applies thresholding toVoxelsof float data type.
-
Method Details
-
thresholdByte
public static void thresholdByte(Voxels<UnsignedByteBuffer> voxels, int level, BinaryValuesByte binaryValues) Applies thresholding toVoxelsof 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 toVoxelsof 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 tovoxelscontaining 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 toVoxelsUntyped.Only unsigned byte float data types are supported.
- Parameters:
voxels- the voxels, which are always unchanged ifalwaysDuplicateis 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,voxelsare never reused in the output, with new buffers always created.- Returns:
- a
BinaryVoxels, reusingvoxelsif they are of type unsigned byte (andalwaysDuplicateis false), otherwise created newly. - Throws:
OperationFailedException- if an unsupported data-type exists invoxels.
-