Class IterateVoxelsBoundingBox
Object
IterateVoxelsBoundingBox
Utilities for iterating over the subset of image voxels within a bounding-box.
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> voidwithBuffer(BoundingBox box, Voxels<T> voxels, ProcessBufferUnary<T> process) Iterate over each voxel in a bounding-box - with one associated buffer for each slicestatic voidwithCursor(BinaryVoxels<UnsignedByteBuffer> voxels, BoundingBox box, KernelApplicationParameters parameters, ProcessKernelPointCursor process) Iterate over each voxel in a bounding-box using aKernelPointCursor.static booleanwithCursorUntil(BinaryVoxels<UnsignedByteBuffer> voxels, BoundingBox box, KernelApplicationParameters parameters, PredicateKernelPointCursor predicate) Iterate over each voxel in a bounding-box using aKernelPointCursoruntil a predicate returns true..static voidwithMatchingPoints(BoundingBox box, Predicate<Point3i> predicate, ProcessPoint process) Iterate over each voxel in a bounding-box that matches a predicate.static voidwithPoint(BoundingBox box, ProcessPoint process) Iterate over each voxel in a bounding-boxstatic voidwithPointAndIndex(BoundingBox box, ProcessPointAndIndex process) Iterate over each voxel in a bounding-boxstatic <T> voidwithThreeBuffers(BoundingBox box, ReadableTuple3i shiftForSecond, ReadableTuple3i shiftForThird, Voxels<T> voxels1, Voxels<T> voxels2, Voxels<T> voxels3, ProcessBufferTernary<T> process) Iterate over each voxel in a bounding-box - with three associated buffers for each slice.static <T> voidwithTwoBuffers(BoundingBox box, ReadableTuple3i shiftForSecond, Voxels<T> voxels1, Voxels<T> voxels2, ProcessBufferBinary<T, T> process) Iterate over each voxel in a bounding-box - with two associated buffers for each slice, oneVoxelBufferand oneBufferwithTwoBuffersUntil(BoundingBox box, ReadableTuple3i shiftForSecond, Voxels<T> voxels1, Voxels<T> voxels2, PredicateBufferBinary<T> predicate) Iterate over each voxel in a bounding-box - with two associated buffers for each slice - until a predicate evaluates to true.static <S,T> void withTwoMixedBuffers(BoundingBox box, ReadableTuple3i shiftForSecond, Voxels<S> voxels1, Voxels<T> voxels2, ProcessBufferBinaryMixed<S, T> process) Iterate over each voxel in a bounding-box - with two associated buffers for each slice.
-
Method Details
-
withPoint
Iterate over each voxel in a bounding-box- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundsprocess- is called for each voxel within the bounding-box using global coordinates.
-
withPointAndIndex
Iterate over each voxel in a bounding-box- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundsprocess- is called for each voxel within the bounding-box using global coordinates.
-
withMatchingPoints
public static void withMatchingPoints(BoundingBox box, Predicate<Point3i> predicate, ProcessPoint process) Iterate over each voxel in a bounding-box that matches a predicate.- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundspredicate- only voxels that match this predicate are processed.process- is called for each voxel that matchespredicatewithin the bounding-box using global coordinates.
-
withBuffer
Iterate over each voxel in a bounding-box - with one associated buffer for each slice- Type Parameters:
T- buffer-type for voxels- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundsvoxels- voxels in which which {code box} refers to a subregion.process- is called for each voxel within the bounding-box using global coordinates.
-
withTwoBuffers
public static <T> void withTwoBuffers(BoundingBox box, ReadableTuple3i shiftForSecond, Voxels<T> voxels1, Voxels<T> voxels2, ProcessBufferBinary<T, T> process) Iterate over each voxel in a bounding-box - with two associated buffers for each slice, oneVoxelBufferand oneBuffer- Type Parameters:
T- buffer-type for voxels- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundsshiftForSecond- added to the current point invoxels1to give a corresponding point invoxels2.voxels1- voxels in which whichboxrefers to a subregion.voxels2- voxels in which whichbox + shiftForSecondrefers to a subregion.process- is called for each voxel within the bounding-box where the point uses global coordinates without the shift. A newPoint3iis not created on each iteration.
-
withTwoMixedBuffers
public static <S,T> void withTwoMixedBuffers(BoundingBox box, ReadableTuple3i shiftForSecond, Voxels<S> voxels1, Voxels<T> voxels2, ProcessBufferBinaryMixed<S, T> process) Iterate over each voxel in a bounding-box - with two associated buffers for each slice.- Type Parameters:
S- buffer-type for the voxel-buffer forvoxels1).T- buffer-type for the buffer (forvoxels2).- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundsshiftForSecond- added to the current point invoxels1to give a corresponding point invoxels2.voxels1- voxels in which whichboxrefers to a subregion.voxels2- voxels in which whichbox + shiftForSecondrefers to a subregion.process- is called for each voxel within the bounding-box where the point uses global coordinates without the shift. A newPoint3iis not created on each iteration.
-
withTwoBuffersUntil
public static <T> Optional<Point3i> withTwoBuffersUntil(BoundingBox box, ReadableTuple3i shiftForSecond, Voxels<T> voxels1, Voxels<T> voxels2, PredicateBufferBinary<T> predicate) Iterate over each voxel in a bounding-box - with two associated buffers for each slice - until a predicate evaluates to true.predicateis called for each voxel within the bounding-box where the point uses global coordinates without the shift while it continues to evaluate to false. The routine exits on the first occasionpredicateevaluates to true. A newPoint3iis not created on each iteration.- Type Parameters:
T- buffer-type for voxels- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundsshiftForSecond- added to the current point invoxels1to give a corresponding point invoxels2.voxels1- voxels in which whichboxrefers to a subregion.voxels2- voxels in which whichbox + shiftForSecondrefers to a subregion.predicate- the predicate as described above.- Returns:
- the current point (relative to the corner of
box1when the predicate first evaluates to true, orOptional.empty()if no point satisfies the predicate.
-
withThreeBuffers
public static <T> void withThreeBuffers(BoundingBox box, ReadableTuple3i shiftForSecond, ReadableTuple3i shiftForThird, Voxels<T> voxels1, Voxels<T> voxels2, Voxels<T> voxels3, ProcessBufferTernary<T> process) Iterate over each voxel in a bounding-box - with three associated buffers for each slice.- Type Parameters:
T- buffer-type for voxels- Parameters:
box- the box that is used as a condition on what voxels to iterate i.e. only voxels within these boundsshiftForSecond- added to the current point invoxels1to give a corresponding point invoxels2.shiftForThird- added to the current point invoxels1to give a corresponding point invoxels3.voxels1- voxels in which whichboxrefers to a subregion.voxels2- voxels in which whichbox + shiftForSecondrefers to a subregion.voxels3- voxels in which whichbox + shiftForThirdrefers to a subregion.process- is called for each voxel within the bounding-box where the point uses global coordinates without the shift. A newPoint3iis not created on each iteration.
-
withCursor
public static void withCursor(BinaryVoxels<UnsignedByteBuffer> voxels, BoundingBox box, KernelApplicationParameters parameters, ProcessKernelPointCursor process) Iterate over each voxel in a bounding-box using aKernelPointCursor.- Parameters:
voxels- the voxels to iterator overbox- the box to iterate over (with coordinates referring tovoxels.parameters- to use when applying a kernelprocess- process is called for each voxel inside the extent using the same coordinates as the extent.
-
withCursorUntil
public static boolean withCursorUntil(BinaryVoxels<UnsignedByteBuffer> voxels, BoundingBox box, KernelApplicationParameters parameters, PredicateKernelPointCursor predicate) Iterate over each voxel in a bounding-box using aKernelPointCursoruntil a predicate returns true..- Parameters:
voxels- the voxels to iterator overbox- the box to iterate over (with coordinates referring tovoxels.parameters- to use when applying a kernelpredicate- evaluates each position of the cursor.- Returns:
- true as soon as any voxel evaluates true with the
predicate, false if it never happens.
-