23 #ifndef otbImageAndVectorImageOperationFilter_h
24 #define otbImageAndVectorImageOperationFilter_h
26 #include "itkBinaryFunctorImageFilter.h"
27 #include "itkImageToImageFilter.h"
35 template <
typename TInput,
typename TVectorInput,
typename TOutput>
41 typedef enum { MULTIPLICATION,
ADDITION, DIVISION, SUBTRACTION } OperatorType;
45 m_Operator = ADDITION;
60 inline TOutput
operator()(
const TInput& inPix,
const TVectorInput& vInPix)
63 out.SetSize(vInPix.Size());
64 TVectorInput vInTmp = vInPix;
98 for (
unsigned int i = 0; i < vInTmp.Size(); ++i)
126 template <
class TInputImage,
class TVectorInputImage,
class TOutputImage>
128 :
public itk::BinaryFunctorImageFilter<TInputImage, TVectorInputImage, TOutputImage,
129 Functor::ImageAndVectorImageOperationFunctor<typename TInputImage::PixelType, typename TVectorInputImage::PixelType,
130 typename TOutputImage::PixelType>>
139 typedef itk::BinaryFunctorImageFilter<TInputImage, TVectorInputImage, TOutputImage, FunctorType>
Superclass;
161 using Superclass::SetInput;
172 itkGetMacro(UseAddition,
bool);
173 itkGetMacro(UseMultiplication,
bool);
174 itkGetMacro(UseDivision,
bool);
175 itkGetMacro(UseSubtraction,
bool);
180 m_UseAddition =
true;
181 m_UseMultiplication =
false;
182 m_UseDivision =
false;
183 m_UseSubtraction =
false;
184 this->GetFunctor().SetOperator(
static_cast<OperatorType>(1));
189 m_UseAddition =
false;
190 m_UseMultiplication =
true;
191 m_UseDivision =
false;
192 m_UseSubtraction =
false;
193 this->GetFunctor().SetOperator(
static_cast<OperatorType>(0));
198 m_UseAddition =
false;
199 m_UseMultiplication =
false;
200 m_UseDivision =
true;
201 m_UseSubtraction =
false;
202 this->GetFunctor().SetOperator(
static_cast<OperatorType>(2));
207 m_UseAddition =
false;
208 m_UseMultiplication =
false;
209 m_UseDivision =
false;
210 m_UseSubtraction =
true;
211 this->GetFunctor().SetOperator(
static_cast<OperatorType>(3));
222 void GenerateOutputInformation()
override;
236 #ifndef OTB_MANUAL_INSTANTIATION
TOutput::ValueType InternalOutputPixelType
virtual ~ImageAndVectorImageOperationFunctor()
TOutput operator()(const TInput &inPix, const TVectorInput &vInPix)
OperatorType GetOperator()
ImageAndVectorImageOperationFunctor()
TVectorInput::ValueType InternalInputPixelType
void SetOperator(OperatorType oper)
Provides simple pixel to pixel operation between Image and VectorImage.
OutputImageType::PixelType OutputPixelType
ImageAndVectorImageOperationFilter Self
itk::BinaryFunctorImageFilter< TInputImage, TVectorInputImage, TOutputImage, FunctorType > Superclass
InputImageType::PixelType InputPixelType
ImageAndVectorImageOperationFilter(const ImageAndVectorImageOperationFilter &)=delete
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
TOutputImage OutputImageType
void operator=(const ImageAndVectorImageOperationFilter &)=delete
FunctorType::OperatorType OperatorType
TInputImage InputImageType
Functor::ImageAndVectorImageOperationFunctor< typename TInputImage::PixelType, typename TVectorInputImage::PixelType, typename TOutputImage::PixelType > FunctorType
TVectorInputImage VectorInputImageType
VectorInputImageType::PixelType VectorInputPixelType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.