|
OTB
9.0.0
Orfeo Toolbox
|
Go to the documentation of this file.
21 #ifndef otbWrapperInputImageParameter_hxx
22 #define otbWrapperInputImageParameter_hxx
34 #define CLAMP_IMAGE_IF(Out, In, image_base) \
36 In* in_image = dynamic_cast<In*>(image_base); \
39 return Cast<Out, In>(in_image); \
42 #define CLAMP_IMAGE_BASE(T, image_base) \
44 CLAMP_IMAGE_IF(T, UInt8VectorImageType, image_base); \
45 CLAMP_IMAGE_IF(T, Int16VectorImageType, image_base); \
46 CLAMP_IMAGE_IF(T, UInt16VectorImageType, image_base); \
47 CLAMP_IMAGE_IF(T, Int32VectorImageType, image_base); \
48 CLAMP_IMAGE_IF(T, UInt32VectorImageType, image_base); \
50 CLAMP_IMAGE_IF(T, FloatVectorImageType, image_base); \
51 CLAMP_IMAGE_IF(T, DoubleVectorImageType, image_base); \
53 CLAMP_IMAGE_IF(T, ComplexInt16VectorImageType, image_base); \
54 CLAMP_IMAGE_IF(T, ComplexInt32VectorImageType, image_base); \
56 CLAMP_IMAGE_IF(T, ComplexFloatVectorImageType, image_base); \
57 CLAMP_IMAGE_IF(T, ComplexDoubleVectorImageType, image_base); \
59 CLAMP_IMAGE_IF(T, UInt8RGBImageType, image_base); \
60 CLAMP_IMAGE_IF(T, UInt8RGBAImageType, image_base); \
62 CLAMP_IMAGE_IF(T, UInt8ImageType, image_base); \
63 CLAMP_IMAGE_IF(T, Int16ImageType, image_base); \
64 CLAMP_IMAGE_IF(T, UInt16ImageType, image_base); \
65 CLAMP_IMAGE_IF(T, Int32ImageType, image_base); \
66 CLAMP_IMAGE_IF(T, UInt32ImageType, image_base); \
68 CLAMP_IMAGE_IF(T, FloatImageType, image_base); \
69 CLAMP_IMAGE_IF(T, DoubleImageType, image_base); \
71 CLAMP_IMAGE_IF(T, ComplexInt16ImageType, image_base); \
72 CLAMP_IMAGE_IF(T, ComplexInt32ImageType, image_base); \
74 CLAMP_IMAGE_IF(T, ComplexFloatImageType, image_base); \
75 CLAMP_IMAGE_IF(T, ComplexDoubleImageType, image_base); \
81 template <
typename TOutputImage,
typename TInputImage>
87 clamp.ocif->UpdateOutputInformation();
96 template <
class TImageType>
113 typename ReaderType::Pointer reader = ReaderType::New();
117 reader->UpdateOutputInformation();
125 return reader->GetOutput();
132 itkExceptionMacro(
"No input image or filename detected...");
137 if (
dynamic_cast<TImageType*
>(
m_Image.GetPointer()))
139 return dynamic_cast<TImageType*
>(
m_Image.GetPointer());
144 "GetImage() was already called with a different type, "
145 "probably due to two calls to GetParameter<Type>Image with different types in application code.");
159 TImageType *im =
dynamic_cast<TImageType*
>(
m_Image.GetPointer());
177 "GetImage() was already called with a different type, "
178 "probably due to two calls to GetParameter<Type>Image with different types in application code. Expected: "
187 OTBApplicationEngine_EXPORT
ImageBaseType* InputImageParameter::GetImage<ImageBaseType>();
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Helper class (private) which casts and clamps input-image type into output-image type.
itk::ImageBase< 2 > ImageBaseType
constexpr T const & clamp(T const &v, T const &lo, T const &hi) noexcept