public class VoxelsThresholder extends Object
An on voxel is placed in the output-buffer if voxel-value >= level
or
off otherwise.
Modifier and Type | Method and Description |
---|---|
static BinaryVoxels<UnsignedByteBuffer> |
threshold(VoxelsUntyped voxels,
float level,
BinaryValuesByte binaryValues,
Optional<ObjectMask> objectMask,
boolean alwaysDuplicate)
Applies thresholding to
VoxelsUntyped . |
static void |
thresholdByte(Voxels<UnsignedByteBuffer> voxels,
int level,
BinaryValuesByte binaryValues)
Applies thresholding to
Voxels of unsigned byte data type. |
static BinaryVoxels<UnsignedByteBuffer> |
thresholdFloat(Voxels<FloatBuffer> voxels,
float level,
BinaryValuesByte binaryValues)
Applies thresholding to
Voxels of float data type. |
public static void thresholdByte(Voxels<UnsignedByteBuffer> voxels, int level, BinaryValuesByte binaryValues)
Voxels
of unsigned byte data type.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.public static BinaryVoxels<UnsignedByteBuffer> thresholdFloat(Voxels<FloatBuffer> voxels, float level, BinaryValuesByte binaryValues)
Voxels
of float data type.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.BinaryVoxels
, of identical size to voxels
containing
the output of the thresholding.public static BinaryVoxels<UnsignedByteBuffer> threshold(VoxelsUntyped voxels, float level, BinaryValuesByte binaryValues, Optional<ObjectMask> objectMask, boolean alwaysDuplicate) throws OperationFailedException
VoxelsUntyped
.
Only unsigned byte float data types are supported.
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.alwaysDuplicate
- if true, voxels
are never reused in the output, with new
buffers always created.objectMask
- if set, restricts the region where thresholding occurs to correspond to
this object-mask.BinaryVoxels
, reusing voxels
if they are of type unsigned
byte (and alwaysDuplicate
is false), otherwise created newly.OperationFailedException
- if an unsupported data-type exists in voxels
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.