public class Convert extends Object
UnaryBlockOperator to convert blocks between standard ImgLib2 Types.
Provides rounding, optional clamping, and handling unsigned types.
Supported types:
UnsignedByteTypeUnsignedShortTypeUnsignedIntTypeByteTypeShortTypeIntTypeLongTypeFloatTypeDoubleType| Constructor and Description |
|---|
Convert() |
public static <S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>> Function<BlockSupplier<S>,UnaryBlockOperator<S,T>> convert(T targetType)
UnaryBlockOperator to convert blocks from S to
T.
Supported source/target types are ByteType, UnsignedByteType, ShortType, UnsignedShortType, IntType, UnsignedIntType, LongType, UnsignedLongType, FloatType, and DoubleType.
Target values are not clamped, so overflow may occur if the source type has a larger range than the target type.
The returned factory function creates an operator matching the type
S of the given input BlockSupplier<T>.
S - source typeT - target typetargetType - an instance of the target typeUnaryBlockOperator to convert blocks from S to Tpublic static <S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>> Function<BlockSupplier<S>,UnaryBlockOperator<S,T>> convert(T targetType, ClampType clamp)
UnaryBlockOperator to convert blocks from S to
T.
Supported source/target types are ByteType, UnsignedByteType, ShortType, UnsignedShortType, IntType, UnsignedIntType, LongType, UnsignedLongType, FloatType, and DoubleType.
If the target type cannot represent the full range of the source type,
values are clamped according to the specified ClampType.
The returned factory function creates an operator matching the type
S of the given input BlockSupplier<T>.
S - source typeT - target typetargetType - an instance of the target typeclamp - ClampTypeUnaryBlockOperator to convert blocks from S to Tpublic static <S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>> Function<BlockSupplier<S>,UnaryBlockOperator<S,T>> convert(T targetType, Supplier<net.imglib2.converter.Converter<? super S,T>> converterSupplier)
UnaryBlockOperator to convert blocks from S to
T with the specified Converter.
The returned factory function creates an operator matching the type
S of the given input BlockSupplier<T>.
S - source typeT - target typetargetType - an instance of the target typeconverterSupplier - creates new converter instancesUnaryBlockOperator to convert blocks from S to Tpublic static <S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>> UnaryBlockOperator<S,T> createOperator(S sourceType, T targetType)
public static <S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>> UnaryBlockOperator<S,T> createOperator(S sourceType, T targetType, ClampType clamp)
UnaryBlockOperator to convert blocks between sourceType and targetType.
Clamp target values according to clamp.public static <S extends net.imglib2.type.NativeType<S>,T extends net.imglib2.type.NativeType<T>> UnaryBlockOperator<S,T> createOperator(S sourceType, T targetType, Supplier<net.imglib2.converter.Converter<? super S,T>> converterSupplier)
UnaryBlockOperator to convert blocks between sourceType and targetType with the specified Converter.Copyright © 2009–2026 ImgLib2. All rights reserved.