Class IterateVoxelsAll
Voxels
.
A processor is called on each voxel.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
anyPredicateMatch
(Voxels<T> voxels, Predicate<T> predicate) Tries to apply a predicate to all the remaining buffer locations, returning true if the predicate matches.static void
assignEachMatchingPoint
(Voxels<?> voxels, IntPredicate predicate, int valueToAssign) Assigns a value to any voxel whose intensity matches a predicate, reading and writing the buffer as anint
.static void
binaryOperation
(Voxels<UnsignedByteBuffer> voxelsIn1, Voxels<UnsignedByteBuffer> voxelsIn2, Voxels<UnsignedByteBuffer> voxelsOut, IntBinaryOperator operation) Iterate over each voxel in a bounding-box - applying a binary operation with values from two inputVoxels<UnsignedByteBuffer>
for each slice and writing it into an outputVoxels<UnsignedByteBuffer>
.static void
changeIntensity
(Voxels<?> voxels, IntUnaryOperator operator) Changes each voxel, reading and writing the buffer as anint
.static <T extends UnsignedBufferAsInt>
intintensityMax
(Voxels<T> voxels) Finds the maximum intensity-value (as an int) among all voxels.static <T extends UnsignedBufferAsInt>
intintensityMin
(Voxels<T> voxels) Finds the minimum intensity-value (as an int) among all voxels.static <T extends UnsignedBufferAsInt>
MinMaxRangeintensityMinMax
(Voxels<T> voxels) Finds the maximum intensity-value (as an int) among all voxels.static <T> void
withBuffer
(Voxels<T> voxels, ProcessBufferUnary<T> process) Iterate over each voxel - with one associated buffer for each slice.static void
withCursor
(BinaryVoxels<UnsignedByteBuffer> voxels, KernelApplicationParameters parameters, ProcessKernelPointCursor process) Iterate over each voxel using aKernelPointCursor
.static void
withPoint
(Extent extent, ProcessPoint process) Iterate over each voxel in anExtent
static void
withPointAndIndex
(Extent extent, ProcessPointAndIndex process) Iterate over each voxel in anExtent
.static <T> void
withThreeBuffers
(Voxels<T> voxels1, Voxels<T> voxels2, Voxels<T> voxels3, ProcessBufferTernary<T> process) Iterate over each voxel - with three associated buffers for each slice.static <S,
T> void withTwoBuffersAndPoint
(Voxels<S> voxels1, Voxels<T> voxels2, ProcessBufferBinary<S, T> process) Iterate over each voxel - with two associated buffers for each slicestatic <S,
T> void withTwoMixedBuffers
(Voxels<S> voxels1, Voxels<T> voxels2, ProcessVoxelBufferBinaryMixed<S, T> process) Iterate over each voxel in a bounding-box - with one associated voxel-buffer and one associated buffer for each slice.static <S,
T> void withTwoVoxelBuffers
(Voxels<S> voxels1, Voxels<T> voxels2, ProcessVoxelBufferBinary<S, T> process) Iterate over each voxel in a bounding-box - with two associated voxel-buffers for each slicestatic <T> void
withVoxelBuffer
(Voxels<T> voxels, ProcessVoxelBufferUnary<T> process) Iterate over each voxel - with one associated voxel-buffer for each slice.static <T,
E extends Exception>
voidwithVoxelBuffer
(Voxels<T> voxels, ProcessVoxelBufferUnaryWithPoint<T, E> process) Iterate over each voxel - with one associated voxel-buffer for each slice.
-
Method Details
-
withPoint
Iterate over each voxel in anExtent
- Parameters:
extent
- the extent to be iterated overprocess
- process is called for each voxel inside the extent using the same coordinates as the extent.
-
withPointAndIndex
Iterate over each voxel in anExtent
.- Parameters:
extent
- the extent to be iterated overprocess
- process is called for each voxel inside the extent using the same coordinates as the extent.
-
withCursor
public static void withCursor(BinaryVoxels<UnsignedByteBuffer> voxels, KernelApplicationParameters parameters, ProcessKernelPointCursor process) Iterate over each voxel using aKernelPointCursor
.- Parameters:
voxels
- the voxels to iterator overparameters
- to use when applying a kernelprocess
- process is called for each voxel inside the extent using the same coordinates as the extent.
-
withBuffer
Iterate over each voxel - with one associated buffer for each slice.- Type Parameters:
T
- buffer-type for voxels- Parameters:
voxels
- voxels to be iterated over (in their entirety)process
- is called for each voxel within the bounding-box using global coordinates.
-
withTwoBuffersAndPoint
public static <S,T> void withTwoBuffersAndPoint(Voxels<S> voxels1, Voxels<T> voxels2, ProcessBufferBinary<S, T> process) Iterate over each voxel - with two associated buffers for each sliceThe extent's of both
voxels1
andvoxels2
must be equal.- Type Parameters:
S
- first buffer-type for voxelsT
- second buffer-type for voxels- Parameters:
voxels1
- first voxels provides the first buffervoxels2
- second voxelsprocess
- is called for each voxel using global coordinates.
-
withThreeBuffers
public static <T> void withThreeBuffers(Voxels<T> voxels1, Voxels<T> voxels2, Voxels<T> voxels3, ProcessBufferTernary<T> process) Iterate over each voxel - with three associated buffers for each slice.The extent's of both
voxels1
andvoxels2
andvoxels3
must be equal.- Type Parameters:
T
- buffer-type for voxels- Parameters:
voxels1
- 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 buffervoxels3
- voxels in which whichBoundingBox
refers to a subregion, and which provides the third bufferprocess
- is called for each voxel within the bounding-box using global coordinates.
-
withVoxelBuffer
Iterate over each voxel - with one associated voxel-buffer for each slice.It is similar to
withVoxelBuffer(Voxels, ProcessVoxelBufferUnaryWithPoint)
but aPoint3i
is not exposed.- Type Parameters:
T
- buffer-type for voxels- Parameters:
voxels
- voxels to be iterated over (in their entirety)process
- is called for each voxel within the bounding-box using global coordinates.
-
withVoxelBuffer
public static <T,E extends Exception> void withVoxelBuffer(Voxels<T> voxels, ProcessVoxelBufferUnaryWithPoint<T, E> process) throws EIterate over each voxel - with one associated voxel-buffer for each slice.It is similar to
withVoxelBuffer(Voxels, ProcessVoxelBufferUnary)
but aPoint3i
is also exposed.- Type Parameters:
T
- buffer-type for voxels- Parameters:
voxels
- voxels to be iterated over (in their entirety)process
- is called for each voxel within the bounding-box using global coordinates.- Throws:
E
- exception that may be thrown by the processor
-
withTwoVoxelBuffers
public static <S,T> void withTwoVoxelBuffers(Voxels<S> voxels1, Voxels<T> voxels2, ProcessVoxelBufferBinary<S, T> process) Iterate over each voxel in a bounding-box - with two associated voxel-buffers for each sliceThe extent's of both
voxels1
andvoxels2
must be equal.- Type Parameters:
T
- buffer-type for voxels- Parameters:
voxels1
- voxels that provide the first voxel-buffervoxels2
- voxels that provide the second bufferprocess
- is called for each voxel using global coordinates.
-
withTwoMixedBuffers
public static <S,T> void withTwoMixedBuffers(Voxels<S> voxels1, Voxels<T> voxels2, ProcessVoxelBufferBinaryMixed<S, T> process) Iterate over each voxel in a bounding-box - 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:
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.
-
anyPredicateMatch
Tries to apply a predicate to all the remaining buffer locations, returning true if the predicate matches.The predicate should test only the current element of the buffer, although the whole buffer (of type
T
is passed as an argument. It should also advance the position in the buffer (as automatically occurs ifget()
is called.- Type Parameters:
T
- buffer-type- Parameters:
voxels
- the voxels to iterate throughpredicate
- the predicate on the current element of the buffer- Returns:
- true if the predicate matches any voxel, false otherwise
-
changeIntensity
Changes each voxel, reading and writing the buffer as anint
.Note this provides slower access than operating on the native-types.
- Parameters:
voxels
- the voxels, each of which is transformed byoperator
operator
- determines a corresponding output value for each input voxel
-
intensityMin
Finds the minimum intensity-value (as an int) among all voxels.Note this provides slower access than operating on the native-types.
- Type Parameters:
T
- the buffer-type- Parameters:
voxels
- the voxels- Returns:
- whatever the minimum value is.
-
intensityMax
Finds the maximum intensity-value (as an int) among all voxels.Note this provides slower access than operating on the native-types.
- Type Parameters:
T
- the buffer-type- Parameters:
voxels
- the voxels- Returns:
- whatever the maximum value is.
-
intensityMinMax
Finds the maximum intensity-value (as an int) among all voxels.Note this provides slower access than operating on the native-types.
- Type Parameters:
T
- the buffer-type- Parameters:
voxels
- the voxels.- Returns:
- a newly created
MinMaxRange
containing the minimum and maximum voxel value.
-
assignEachMatchingPoint
public static void assignEachMatchingPoint(Voxels<?> voxels, IntPredicate predicate, int valueToAssign) Assigns a value to any voxel whose intensity matches a predicate, reading and writing the buffer as anint
.Note this provides slower access than operating on the native-types.
- Parameters:
voxels
- the voxels, each of which is tested bypredicate
and maybe assigned a new valuepredicate
- determines if a voxel-value should be assigned or notvalueToAssign
- the value to assign
-
binaryOperation
public static void binaryOperation(Voxels<UnsignedByteBuffer> voxelsIn1, Voxels<UnsignedByteBuffer> voxelsIn2, Voxels<UnsignedByteBuffer> voxelsOut, IntBinaryOperator operation) Iterate over each voxel in a bounding-box - applying a binary operation with values from two inputVoxels<UnsignedByteBuffer>
for each slice and writing it into an outputVoxels<UnsignedByteBuffer>
.The extent's of both
voxelsIn1
andvoxelsIn2
andvoxelsOut
must be equal.- Parameters:
voxelsIn1
- voxels in which whichBoundingBox
refers to a subregion, and which provides the first inwards buffervoxelsIn2
- voxels in which whichBoundingBox
refers to a subregion, and which provides the second inwards buffervoxelsOut
- voxels in which whichBoundingBox
refers to a subregion, and which provides the outwards bufferoperation
- is called for each voxel within the bounding-box using global coordinates.
-