S - source pixel typeT - target pixel typepublic interface UnaryBlockOperator<S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>>
UnaryBlockOperator computes blocks of NativeType<T> data
from blocks of NativeType<S> data.
Use the compute(BlockSupplier, Interval, Object)
method to compute a block of data and store it into a flat primitive array
(of the appropriate primitive type corresponding to T). The input
block (appropriately sized and positioned to produce the desired output
Interval) is read from a BlockSupplier<S>.
Typically, UnaryBlockOperator are chained to a particular BlockSupplier<S> using BlockSupplier.andThen(net.imglib2.algorithm.blocks.UnaryBlockOperator<T, U>) (or applyTo(net.imglib2.algorithm.blocks.BlockSupplier<S>),
instead of calling compute() explicitly.
Implementations are not thread-safe in general. Use independentCopy() to obtain independent instances.
| Modifier and Type | Method and Description |
|---|---|
default <U extends net.imglib2.type.NativeType<U>> |
adaptSourceType(U newSourceType,
ClampType clamp)
Returns a
UnaryBlockOperator that is equivalent to converting the
input values to type U (possibly clamping to the range of
U). and then applying this to the result. |
default <U extends net.imglib2.type.NativeType<U>> |
adaptTargetType(U newTargetType,
ClampType clamp)
Returns a
UnaryBlockOperator that is equivalent to applying
this, an then converting the output values to type U
(possibly clamping to the range of U). |
default <U extends net.imglib2.type.NativeType<U>> |
andThen(UnaryBlockOperator<T,U> op)
Returns a
UnaryBlockOperator that is equivalent to applying
this, and then applying op to the result. |
default BlockSupplier<T> |
applyTo(BlockSupplier<S> blocks)
Returns a
BlockSupplier<T> that provide blocks by computing on input blocks from the given BlockSupplier<S>. |
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). |
S |
getSourceType() |
T |
getTargetType() |
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. |
int |
numSourceDimensions()
Number of source dimensions.
|
int |
numTargetDimensions()
Number of target dimensions.
|
void compute(BlockSupplier<S> src, net.imglib2.Interval interval, Object dest)
src 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[].S getSourceType()
T getTargetType()
int numSourceDimensions()
Some operators can be applied to arbitrary dimensions, e.g., converters.
In this case, they should return numSourceDimensions() <= 0. It
is expected that these operators do not modify the number of dimensions,
that is, when such an operator is applied to a 3D block, the result is
also a 3D block.
int numTargetDimensions()
Some operators can be applied to arbitrary dimensions, e.g., converters.
In this case, they should return numTargetDimensions() <= 0. It
is expected that these operators do not modify the number of dimensions,
that is, when such an operator is applied to a 3D block, the result is
also a 3D block.
UnaryBlockOperator<S,T> independentCopy()
UnaryBlockOperator that can be used
independently, e.g., in another thread or in another place in the same
pipeline.default BlockSupplier<T> applyTo(BlockSupplier<S> blocks)
BlockSupplier<T> that provide blocks by computing on input blocks from the given BlockSupplier<S>.default <U extends net.imglib2.type.NativeType<U>> UnaryBlockOperator<S,U> andThen(UnaryBlockOperator<T,U> op)
UnaryBlockOperator that is equivalent to applying
this, and then applying op to the result.default <U extends net.imglib2.type.NativeType<U>> UnaryBlockOperator<U,T> adaptSourceType(U newSourceType, ClampType clamp)
UnaryBlockOperator that is equivalent to converting the
input values to type U (possibly clamping to the range of
U). and then applying this to the result.default <U extends net.imglib2.type.NativeType<U>> UnaryBlockOperator<S,U> adaptTargetType(U newTargetType, ClampType clamp)
UnaryBlockOperator that is equivalent to applying
this, an then converting the output values to type U
(possibly clamping to the range of U).Copyright © 2009–2026 ImgLib2. All rights reserved.