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 void
thresholdByte
(Voxels<UnsignedByteBuffer> voxels, int level, BinaryValuesByte binaryValues) Applies thresholding toVoxels
of unsigned byte data type.static BinaryVoxels
<UnsignedByteBuffer> thresholdFloat
(Voxels<FloatBuffer> voxels, float level, BinaryValuesByte binaryValues) Applies thresholding toVoxels
of float data type.
-
Method Details
-
thresholdByte
public static void thresholdByte(Voxels<UnsignedByteBuffer> voxels, int level, BinaryValuesByte binaryValues) Applies thresholding toVoxels
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 toVoxels
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 tovoxels
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 toVoxelsUntyped
.Only unsigned byte float data types are supported.
- Parameters:
voxels
- the voxels, which are always unchanged ifalwaysDuplicate
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
, reusingvoxels
if they are of type unsigned byte (andalwaysDuplicate
is false), otherwise created newly. - Throws:
OperationFailedException
- if an unsupported data-type exists invoxels
.
-