Class IterateVoxelsObjectMask
ObjectMask
.
The utilities operate on one or more Voxels
. A processor is called on each selected
voxel.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
allMatchIntensity
(ObjectMask object, Voxels<T> voxels, 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 fromVoxels
.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-maskstatic void
withPoint
(ObjectMask object, ProcessPoint process) Iterate over each voxel that is located on an object-maskstatic <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. the entire image.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 associatedVoxelBuffer
.static <T> void
withVoxelBuffer
(ObjectMask object, Voxels<T> voxels, ProcessVoxelBufferUnary<T> process) Iterate over each voxel on an object-mask with one associatedVoxelBuffer
.
-
Method Details
-
withPoint
Iterate over each voxel that is located on an object-mask- Parameters:
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.
-
withPoint
public 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-maskIf a second object-mask is defined, it is a logical AND condition. A voxel is only processed if it exists in both object-masks.
- Parameters:
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.
-
withBuffer
public 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 fromVoxels
.- Type Parameters:
T
- buffer-type for voxels- Parameters:
object
- 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.
-
withTwoBuffers
public 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. the entire image.The extent's of both
voxels1
andvoxels2
must be equal, and equal to the coordinate spaceobject
is defined on.- Type Parameters:
S
- first buffer-type for voxels.T
- second buffer-type for voxels.- Parameters:
object
- an object-mask which restricts which voxels ofvoxels1
andvoxels2
are iteratedvoxels1
- voxels in which whichBoundingBox
refers to a subregion, and which provides the first buffervoxels2
- voxels in which whichBoundingBox
refers to a subregion, and which provides the second bufferprocess
- is called for each voxel within the bounding-box using global coordinates.
-
withVoxelBuffer
public static <T> void withVoxelBuffer(ObjectMask object, Voxels<T> voxels, ProcessVoxelBufferUnary<T> process) Iterate over each voxel on an object-mask with one associatedVoxelBuffer
.Optionally, the iteration can be restricted to a sub-region of the object-mask.
- Type Parameters:
T
- buffer-type- Parameters:
object
- the object-mask (global coordinates)voxels
- voxels which provide a buffer passed toprocess
process
- processes each point that fulfills the conditions
-
withVoxelBuffer
public 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 associatedVoxelBuffer
.Optionally, the iteration can be restricted to a sub-region of the object-mask.
- Type Parameters:
T
- buffer-type- Parameters:
object
- the object-mask (global coordinates)voxels
- voxels which provide a buffer passed toprocess
restrictTo
- optional sub-region of object-mask (global coordinates)process
- processes each point that fulfills the conditions
-
withTwoVoxelBuffers
public 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.The extent's of both
voxels1
andvoxels2
must be equal.- Type Parameters:
T
- buffer-type for voxels- Parameters:
object
- the object-mask, with coordinates relative to bothvoxels1
andvoxels2
.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.
-
withTwoMixedBuffers
public 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.The extent's of both
voxels1
andvoxels2
must be equal.Note that a new
Point3i
is created for each call toprocess
.- Type Parameters:
T
- buffer-type for voxels- Parameters:
object
- the object-mask, with coordinates relative to bothvoxels1
andvoxels2
.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.
-
allMatchIntensity
public static <T> boolean allMatchIntensity(ObjectMask object, Voxels<T> voxels, IntPredicate predicate) Do all points on an object-mask match a predicate on the point's voxel-intensity?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.
- Type Parameters:
T
- buffer-type- Parameters:
object
- the object-mask (global coordinates) to restrict which voxels are tested with the predicatevoxels
- voxels which provide a buffer passed to the predicatepredicate
- a predicate applied on the intensity of each voxel- Returns:
- true if the predicate returns true for all points on the object-mask, false otherwise
-