S - source typeT - target typepublic interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>
BlockProcessor<I,O>, where I is the primitive array
type backing ImgLib2 NativeType S and O is the
primitive array type backing ImgLib2 NativeType T.
Typically, UnaryBlockOperator should be used rather than BlockProcessor directly, to avoid mistakes with unchecked (primitive array)
type casts.
| Modifier and Type | Method and Description |
|---|---|
default <U extends 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). |
default <U extends 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 NativeType<U>> |
andThen(UnaryBlockOperator<T,U> op)
Returns a
UnaryBlockOperator that is equivalent to applying
this, and then applying op to the result. |
<I,O> BlockProcessor<I,O> |
blockProcessor()
Get (an instance of) the wrapped
BlockProcessor. |
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.
|
UnaryBlockOperator<S,T> |
threadSafe()
Get a thread-safe version of this
UnaryBlockOperator. |
<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 intented for internal use, e.g., in BlockAlgoUtils.
I - input primitive array type, e.g., float[]. Must correspond to S.O - output primitive array type, e.g., float[]. Must correspond to T.BlockProcessorS 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> threadSafe()
UnaryBlockOperator.
(Implemented as a wrapper that makes ThreadLocal copies).UnaryBlockOperator<S,T> independentCopy()
UnaryBlockOperator that can be used
independently, e.g., in another thread or in another place in the same
pipeline.default <U extends 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 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 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–2024 ImgLib2. All rights reserved.