I - input primitive array type, e.g., float[]O - output primitive array type, e.g., float[]public interface BlockProcessor<I,O>
BlockProcessor computes values in a flattened primitive output
array from values in a flattened primitive input array.
Typically, BlockProcessor should not be used directly, but
wrapped in UnaryBlockOperator which has the ImgLib2 Types
corresponding to I, O. This helps to avoid mistakes with
unchecked (primitive array) type casts.
| Modifier and Type | Method and Description |
|---|---|
default <P> BlockProcessor<I,P> |
andThen(BlockProcessor<O,P> processor)
Returns a
BlockProcessor concatenated such that |
void |
compute(I src,
O dest)
Compute the
dest array from the src array. |
I |
getSourceBuffer()
Get a
src array of sufficient size. |
Interval |
getSourceInterval() |
long[] |
getSourcePos() |
int[] |
getSourceSize() |
BlockProcessor<I,O> |
independentCopy() |
void |
setTargetInterval(Interval interval) |
default void |
setTargetInterval(long[] pos,
int[] size) |
BlockProcessor<I,O> independentCopy()
void setTargetInterval(Interval interval)
default void setTargetInterval(long[] pos,
int[] size)
long[] getSourcePos()
int[] getSourceSize()
Interval getSourceInterval()
I getSourceBuffer()
src array of sufficient size.
Consecutive calls may return the same array, but don't have to.
void compute(I src, O dest)
dest array from the src array.
src and dest are expected to be flattened arrays of the
dimensions specified in setTargetInterval(net.imglib2.Interval) and computed in getSourceSize(), respectively. The typical sequence is:
dest with known flattened layout and min
position should be computed.setTargetInterval(net.imglib2.Interval). This will compute the corresponding
source interval (also available as getSourcePos(), getSourceSize()) including BlockProcessor-specific transformations, padding, etc.src array (either provided by getSourceBuffer(), or otherwise allocated) with the input data (see
PrimitiveBlocks.copy(long[], java.lang.Object, int[])).compute(src, dest) to compute the target array.src and dest arrays may be larger than
implied by setTargetInterval and getSourceSize. In that
case the trailing elements are ignored.
Typically, BlockProcessor should not be used directly, but
wrapped in UnaryBlockOperator which has the ImgLib2 Types
corresponding to I, O.
src - flattened primitive array with input valuesdest - flattened primitive array to fill with output valuesdefault <P> BlockProcessor<I,P> andThen(BlockProcessor<O,P> processor)
BlockProcessor concatenated such that
concatenated.compute(src, dest);
is equivalent to
this.compute(src, tmp);
processor.compute(tmp, dest);
Copyright © 2009–2024 ImgLib2. All rights reserved.