public class IterateVoxelsObjectMask extends Object
ObjectMask
.
The utilities operate on one or more Voxels
. A processor is called on each selected
voxel.
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
allMatchIntensity(ObjectMask object,
Voxels<T> voxels,
java.util.function.IntPredicate predicate)
Do all points on an object-mask match a predicate on the point's voxel-intensity?
|
static <T> void |
withBuffer(ObjectMask object,
Voxels<T> voxels,
ProcessBufferUnary<T> process)
Iterate over each voxel in an object-mask - with one associated buffer for each
slice from
Voxels . |
static void |
withPoint(ObjectMask firstMask,
Optional<ObjectMask> secondMask,
ProcessPoint process)
Iterate over each point that is located on an object-mask AND optionally a second-mask
|
static void |
withPoint(ObjectMask object,
ProcessPoint process)
Iterate over each voxel that is located on an object-mask
|
static <S,T> void |
withTwoBuffers(ObjectMask object,
Voxels<S> voxels1,
Voxels<T> voxels2,
ProcessBufferBinary<S,T> process)
Iterate over each voxel with a corresponding on value in an object-mask - and with
two associated buffers for each slice covering the all the global space
i.e.
|
static <S,T> void |
withTwoMixedBuffers(ObjectMask object,
Voxels<S> voxels1,
Voxels<T> voxels2,
ProcessVoxelBufferBinaryMixed<S,T> process)
Iterate over each voxel in an object-mask - with one associated voxel-buffer and
one associated buffer for each slice.
|
static <S,T> void |
withTwoVoxelBuffers(ObjectMask object,
Voxels<S> voxels1,
Voxels<T> voxels2,
ProcessVoxelBufferBinary<S,T> process)
Iterate over each voxel in an object-mask - with two associated voxel-buffers and for
each slice.
|
static <T> void |
withVoxelBuffer(ObjectMask object,
Voxels<T> voxels,
Optional<BoundingBox> restrictTo,
ProcessVoxelBufferUnary<T> process)
Iterate over each voxel on an object-mask with one associated
VoxelBuffer . |
static <T> void |
withVoxelBuffer(ObjectMask object,
Voxels<T> voxels,
ProcessVoxelBufferUnary<T> process)
Iterate over each voxel on an object-mask with one associated
VoxelBuffer . |
public static void withPoint(ObjectMask object, ProcessPoint process)
object
- the object-mask that is used as a condition on what voxels to iterateprocess
- process is called for each voxel with that satisfies the conditions using
global coordinates.public static void withPoint(ObjectMask firstMask, Optional<ObjectMask> secondMask, ProcessPoint process)
If a second object-mask is defined, it is a logical AND condition. A voxel is only processed if it exists in both object-masks.
firstMask
- the first-mask that is used as a condition on what voxels to iteratesecondMask
- an optional second-mask that can be a further conditionprocess
- is called for each voxel with that satisfies the conditions using GLOBAL
coordinates for each voxel.public static <T> void withBuffer(ObjectMask object, Voxels<T> voxels, ProcessBufferUnary<T> process)
Voxels
.T
- buffer-type for voxelsobject
- the object-mask is used as a condition on what voxels to iterate i.e. only
voxels within these boundsvoxels
- voxels where buffers extracted from be processed, and which define the global
coordinate spaceprocess
- is called for each voxel within the bounding-box using global
coordinates.public static <S,T> void withTwoBuffers(ObjectMask object, Voxels<S> voxels1, Voxels<T> voxels2, ProcessBufferBinary<S,T> process)
The extent's of both voxels1
and voxels2
must be equal, and equal to the
coordinate space object
is defined on.
S
- first buffer-type for voxels.T
- second buffer-type for voxels.object
- an object-mask which restricts which voxels of voxels1
and voxels2
are iteratedvoxels1
- voxels in which which BoundingBox
refers to a subregion, and which
provides the first buffervoxels2
- voxels in which which BoundingBox
refers to a subregion, and which
provides the second bufferprocess
- is called for each voxel within the bounding-box using global
coordinates.public static <T> void withVoxelBuffer(ObjectMask object, Voxels<T> voxels, ProcessVoxelBufferUnary<T> process)
VoxelBuffer
.
Optionally, the iteration can be restricted to a sub-region of the object-mask.
T
- buffer-typevoxels
- voxels which provide a buffer passed to process
object
- the object-mask (global coordinates)process
- processes each point that fulfills the conditionspublic static <T> void withVoxelBuffer(ObjectMask object, Voxels<T> voxels, Optional<BoundingBox> restrictTo, ProcessVoxelBufferUnary<T> process)
VoxelBuffer
.
Optionally, the iteration can be restricted to a sub-region of the object-mask.
T
- buffer-typevoxels
- voxels which provide a buffer passed to process
object
- the object-mask (global coordinates)restrictTo
- optional sub-region of object-mask (global coordinates)process
- processes each point that fulfills the conditionspublic static <S,T> void withTwoVoxelBuffers(ObjectMask object, Voxels<S> voxels1, Voxels<T> voxels2, ProcessVoxelBufferBinary<S,T> process)
The extent's of both voxels1
and voxels2
must be equal.
T
- buffer-type for voxelsobject
- the object-mask, with coordinates relative to both voxels1
and voxels2
.voxels1
- voxels that provide the element from the first voxel-buffer.voxels2
- voxels that provide the element from the second voxel-buffer.process
- is called for each voxel using global coordinates.public static <S,T> void withTwoMixedBuffers(ObjectMask object, Voxels<S> voxels1, Voxels<T> voxels2, ProcessVoxelBufferBinaryMixed<S,T> process)
The extent's of both voxels1
and voxels2
must be equal.
Note that a new Point3i
is created for each call to process
.
T
- buffer-type for voxelsobject
- the object-mask, with coordinates relative to both voxels1
and voxels2
.voxels1
- voxels that provide the first element, the voxel-buffer.voxels2
- voxels that provide the second element, the buffer.process
- is called for each voxel using global coordinates.public static <T> boolean allMatchIntensity(ObjectMask object, Voxels<T> voxels, java.util.function.IntPredicate predicate)
The voxel-value of the current buffer is passed to the predicate.
As soon as one voxel fails the predicate (i.e. the predicate returns false), the function immediately returns false.
T
- buffer-typevoxels
- voxels which provide a buffer passed to the predicateobject
- the object-mask (global coordinates) to restrict which voxels are tested with
the predicatepredicate
- a predicate applied on the intensity of each voxelCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.