21 #ifndef otbImageOfVectorsToMonoChannelExtractROI_hxx
22 #define otbImageOfVectorsToMonoChannelExtractROI_hxx
32 template <
class TInputImage,
class TOutputImage>
35 this->DynamicMultiThreadingOn();
41 template <
class TInputImage,
class TOutputImage>
44 Superclass::PrintSelf(os, indent);
56 template <
class TInputImage,
class TOutputImage>
59 typename Superclass::InputImageConstPointer inputPtr = this->GetInput();
61 if ((m_Channel <= 0) || (m_Channel > InputImagePixelType::Dimension))
63 itkExceptionMacro(<<
"otb::ExtractImImageOfVectorsToMonoChannelExtractROIageFilter::GenerateOutputInformation "
64 <<
" Channel must be in the following range: [1;" << InputImagePixelType::Dimension <<
"] "
65 <<
typeid(itk::ImageBase<InputImageDimension>*).name());
70 Superclass::GenerateOutputInformation();
73 template <
class TInputImage,
class TOutputImage>
76 itkDebugMacro(<<
"Actually executing");
79 typename Superclass::InputImageConstPointer inputPtr = this->GetInput();
80 typename Superclass::OutputImagePointer outputPtr = this->GetOutput();
84 this->CallCopyOutputRegionToInputRegion(inputRegionForThread, outputRegionForThread);
87 typedef itk::ImageRegionIterator<OutputImageType> OutputIterator;
88 typedef itk::ImageRegionConstIterator<InputImageType> InputIterator;
90 OutputIterator outIt(outputPtr, outputRegionForThread);
91 InputIterator inIt(inputPtr, inputRegionForThread);
94 unsigned int channelIn(m_Channel - 1);
97 while (!outIt.IsAtEnd())
100 pixelInput = inIt.Get();
102 outIt.Set(pixelOutput);
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.