18 #ifndef __otbMultiChannelGAndRIndexImageFilter_h
19 #define __otbMultiChannelGAndRIndexImageFilter_h
38 template <
class TInputImage,
class TOutputImage,
39 class TFunction = Functor::IR<
typename TInputImage::InternalPixelType,
40 typename TInputImage::InternalPixelType,
41 typename TOutputImage::PixelType> >
62 itkSetMacro(GreenIndex,
unsigned int);
63 itkGetMacro(GreenIndex,
unsigned int);
65 itkSetMacro(RedIndex,
unsigned int);
66 itkGetMacro(RedIndex,
unsigned int);
77 m_GreenIndex = channel;
99 virtual void BeforeThreadedGenerateData()
101 unsigned int lNbChan = this->GetInput()->GetNumberOfComponentsPerPixel();
102 if (m_GreenIndex < 1 || m_RedIndex < 1 ||
103 m_GreenIndex > lNbChan || m_RedIndex > lNbChan)
105 itkExceptionMacro(<<
"Channel indices must belong to range [1, ...[");
107 this->GetFunctor().SetGreenIndex(m_GreenIndex);
108 this->GetFunctor().SetRedIndex(m_RedIndex);
113 this->Superclass::PrintSelf(os, indent);
114 os << indent <<
"Green index: " << m_GreenIndex << std::endl;
115 os << indent <<
"Red index: " << m_RedIndex << std::endl;
119 void operator =(
const Self&);