S - source typeT - target typepublic class DefaultUnaryBlockOperator<S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>> extends AbstractUnaryBlockOperator<S,T>
UnaryBlockOperator.
If you implement a BlockProcessor<I,O>, you typically wrap it with a
DefaultUnaryBlockOperator, specifying the source S and target
T ImgLib2 NativeTypes corresponding to primitive array types
I and O, and the number of source and target dimension.
The UnaryBlockOperator can then be used in BlockSupplier.andThen(UnaryBlockOperator) chains in a type- and
dimensionality-safe manner.
| Constructor and Description |
|---|
DefaultUnaryBlockOperator(S sourceType,
T targetType,
int numSourceDimensions,
int numTargetDimensions,
BlockProcessor<?,?> blockProcessor) |
| Modifier and Type | Method and Description |
|---|---|
<I,O> BlockProcessor<I,O> |
blockProcessor()
Get (an instance of) the wrapped
BlockProcessor. |
void |
compute(BlockSupplier<S> src,
net.imglib2.Interval interval,
Object dest)
Compute a block (using
src to provide input data) and store into the given primitive array (of the appropriate type). |
UnaryBlockOperator<S,T> |
independentCopy()
Returns an instance of this
UnaryBlockOperator that can be used
independently, e.g., in another thread or in another place in the same
pipeline. |
getSourceType, getTargetType, numSourceDimensions, numTargetDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptSourceType, adaptTargetType, andThen, applyTopublic DefaultUnaryBlockOperator(S sourceType, T targetType, int numSourceDimensions, int numTargetDimensions, BlockProcessor<?,?> blockProcessor)
public void compute(BlockSupplier<S> src, net.imglib2.Interval interval, Object dest)
UnaryBlockOperatorsrc to provide input data) and store into the given primitive array (of the appropriate type).src - the BlockSupplier that provides input datainterval - the output interval to computedest - primitive array to store computation result. Must correspond to T, for
example, if T is UnsignedByteType then dest must
be byte[].public UnaryBlockOperator<S,T> independentCopy()
UnaryBlockOperatorUnaryBlockOperator that can be used
independently, e.g., in another thread or in another place in the same
pipeline.public <I,O> BlockProcessor<I,O> blockProcessor()
BlockProcessor.
Note that this involves an unchecked cast, that is, the returned BlockProcessor<I,O> will be cast to the I, O types expected by
the caller.
This is mostly intended for debugging.
I - input primitive array type, e.g., float[]. Must correspond to S.O - output primitive array type, e.g., float[]. Must correspond to T.BlockProcessorCopyright © 2009–2025 ImgLib2. All rights reserved.