Modifier and Type | Method and Description |
---|---|
static <T> boolean |
anyPredicateMatch(Voxels<T> voxels,
java.util.function.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,
java.util.function.IntPredicate predicate,
int valueToAssign)
Assigns a value to any voxel whose intensity matches a predicate, reading and writing the
buffer as an
int . |
static void |
binaryOperation(Voxels<UnsignedByteBuffer> voxelsIn1,
Voxels<UnsignedByteBuffer> voxelsIn2,
Voxels<UnsignedByteBuffer> voxelsOut,
java.util.function.IntBinaryOperator operation)
Iterate over each voxel in a bounding-box - applying a binary operation with values from
two input
Voxels<UnsignedByteBuffer> for each slice and writing it into an
output Voxels<UnsignedByteBuffer> . |
static void |
changeIntensity(Voxels<?> voxels,
java.util.function.IntUnaryOperator operator)
Changes each voxel, reading and writing the buffer as an
int . |
static <T extends UnsignedBufferAsInt> |
intensityMax(Voxels<T> voxels)
Finds the maximum intensity-value (as an int) among all voxels.
|
static <T extends UnsignedBufferAsInt> |
intensityMin(Voxels<T> voxels)
Finds the minimum intensity-value (as an int) among all voxels.
|
static <T extends UnsignedBufferAsInt> |
intensityMinMax(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 a
KernelPointCursor . |
static void |
withPoint(Extent extent,
ProcessPoint process)
Iterate over each voxel in an
Extent |
static void |
withPointAndIndex(Extent extent,
ProcessPointAndIndex process)
Iterate over each voxel in an
Extent . |
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 slice
|
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.
|
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 slice
|
static <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> |
withVoxelBuffer(Voxels<T> voxels,
ProcessVoxelBufferUnaryWithPoint<T,E> process)
Iterate over each voxel - with one associated voxel-buffer for each slice.
|
public static void withPoint(Extent extent, ProcessPoint process)
Extent
extent
- the extent to be iterated overprocess
- process is called for each voxel inside the extent using the same coordinates
as the extent.public static void withPointAndIndex(Extent extent, ProcessPointAndIndex process)
Extent
.extent
- the extent to be iterated overprocess
- process is called for each voxel inside the extent using the same coordinates
as the extent.public static void withCursor(BinaryVoxels<UnsignedByteBuffer> voxels, KernelApplicationParameters parameters, ProcessKernelPointCursor process)
KernelPointCursor
.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.public static <T> void withBuffer(Voxels<T> voxels, ProcessBufferUnary<T> process)
T
- buffer-type for voxelsvoxels
- voxels to be iterated over (in their entirety)process
- is called for each voxel within the bounding-box using global
coordinates.public static <S,T> void withTwoBuffersAndPoint(Voxels<S> voxels1, Voxels<T> voxels2, ProcessBufferBinary<S,T> process)
The extent's of both voxels1
and voxels2
must be equal.
S
- first buffer-type for voxelsT
- second buffer-type for voxelsvoxels1
- first voxels provides the first buffervoxels2
- second voxelsprocess
- is called for each voxel using global coordinates.public static <T> void withThreeBuffers(Voxels<T> voxels1, Voxels<T> voxels2, Voxels<T> voxels3, ProcessBufferTernary<T> process)
The extent's of both voxels1
and voxels2
and voxels3
must be
equal.
T
- buffer-type for voxelsvoxels1
- 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 buffervoxels3
- voxels in which which BoundingBox
refers to a subregion, and which
provides the third bufferprocess
- is called for each voxel within the bounding-box using global
coordinates.public static <T> void withVoxelBuffer(Voxels<T> voxels, ProcessVoxelBufferUnary<T> process)
It is similar to withVoxelBuffer(Voxels, ProcessVoxelBufferUnaryWithPoint)
but a
Point3i
is not exposed.
T
- buffer-type for voxelsvoxels
- voxels to be iterated over (in their entirety)process
- is called for each voxel within the bounding-box using global
coordinates.public static <T,E extends Exception> void withVoxelBuffer(Voxels<T> voxels, ProcessVoxelBufferUnaryWithPoint<T,E> process) throws E extends Exception
It is similar to withVoxelBuffer(Voxels, ProcessVoxelBufferUnary)
but a Point3i
is also exposed.
T
- buffer-type for voxelsvoxels
- voxels to be iterated over (in their entirety)process
- is called for each voxel within the bounding-box using global
coordinates.E
- exception that may be thrown by the processorE extends Exception
public static <S,T> void withTwoVoxelBuffers(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 voxelsvoxels1
- voxels that provide the first voxel-buffervoxels2
- voxels that provide the second bufferprocess
- is called for each voxel using global coordinates.public static <S,T> void withTwoMixedBuffers(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 voxelsvoxels1
- 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 anyPredicateMatch(Voxels<T> voxels, java.util.function.Predicate<T> predicate)
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 if get()
is called.
T
- buffer-typevoxels
- the voxels to iterate throughpredicate
- the predicate on the current element of the bufferpublic static void changeIntensity(Voxels<?> voxels, java.util.function.IntUnaryOperator operator)
int
.
Note this provides slower access than operating on the native-types.
voxels
- the voxels, each of which is transformed by operator
operator
- determines a corresponding output value for each input voxelpublic static <T extends UnsignedBufferAsInt> int intensityMin(Voxels<T> voxels)
Note this provides slower access than operating on the native-types.
T
- the buffer-typevoxels
- the voxelspublic static <T extends UnsignedBufferAsInt> int intensityMax(Voxels<T> voxels)
Note this provides slower access than operating on the native-types.
T
- the buffer-typevoxels
- the voxelspublic static <T extends UnsignedBufferAsInt> MinMaxRange intensityMinMax(Voxels<T> voxels)
Note this provides slower access than operating on the native-types.
T
- the buffer-typevoxels
- the voxels.MinMaxRange
containing the minimum and maximum voxel value.public static void assignEachMatchingPoint(Voxels<?> voxels, java.util.function.IntPredicate predicate, int valueToAssign)
int
.
Note this provides slower access than operating on the native-types.
voxels
- the voxels, each of which is tested by predicate
and maybe assigned a
new valuepredicate
- determines if a voxel-value should be assigned or notvalueToAssign
- the value to assignpublic static void binaryOperation(Voxels<UnsignedByteBuffer> voxelsIn1, Voxels<UnsignedByteBuffer> voxelsIn2, Voxels<UnsignedByteBuffer> voxelsOut, java.util.function.IntBinaryOperator operation)
Voxels<UnsignedByteBuffer>
for each slice and writing it into an
output Voxels<UnsignedByteBuffer>
.
The extent's of both voxelsIn1
and voxelsIn2
and voxelsOut
must be
equal.
voxelsIn1
- voxels in which which BoundingBox
refers to a subregion, and which
provides the first inwards buffervoxelsIn2
- voxels in which which BoundingBox
refers to a subregion, and which
provides the second inwards buffervoxelsOut
- voxels in which which BoundingBox
refers to a subregion, and which
provides the outwards bufferoperation
- is called for each voxel within the bounding-box using global
coordinates.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.