S - source typeT - target typepublic class DefaultUnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>> extends Object implements UnaryBlockOperator<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
simensionality-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. |
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptSourceType, adaptTargetType, andThenpublic DefaultUnaryBlockOperator(S sourceType, T targetType, int numSourceDimensions, int numTargetDimensions, BlockProcessor<?,?> blockProcessor)
public <I,O> BlockProcessor<I,O> blockProcessor()
UnaryBlockOperatorBlockProcessor.
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.
blockProcessor in interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>I - input primitive array type, e.g., float[]. Must correspond to S.O - output primitive array type, e.g., float[]. Must correspond to T.BlockProcessorpublic S getSourceType()
getSourceType in interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>public T getTargetType()
getTargetType in interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>public int numSourceDimensions()
UnaryBlockOperator
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.
numSourceDimensions in interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>public int numTargetDimensions()
UnaryBlockOperator
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.
numTargetDimensions in interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>public UnaryBlockOperator<S,T> independentCopy()
UnaryBlockOperatorUnaryBlockOperator that can be used
independently, e.g., in another thread or in another place in the same
pipeline.independentCopy in interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>public UnaryBlockOperator<S,T> threadSafe()
UnaryBlockOperatorUnaryBlockOperator.
(Implemented as a wrapper that makes ThreadLocal copies).threadSafe in interface UnaryBlockOperator<S extends NativeType<S>,T extends NativeType<T>>Copyright © 2009–2024 ImgLib2. All rights reserved.