21 #ifndef otbOneRIBandImageToOneComplexBandImage_hxx
22 #define otbOneRIBandImageToOneComplexBandImage_hxx
26 #include "itkImageRegionIterator.h"
27 #include "itkImageRegionConstIterator.h"
28 #include "itkProgressReporter.h"
36 template <
class TInputImage,
class TOutputImage>
40 this->DynamicMultiThreadingOn();
47 template <
class TInputImage,
class TOutputImage>
50 if (this->GetInput()->GetNumberOfComponentsPerPixel() != 2)
51 itkExceptionMacro(
"Input image must be made of two bands and only two.");
57 template <
class TInputImage,
class TOutputImage>
61 typename OutputImageType::Pointer output = this->GetOutput();
62 typename InputImageType::ConstPointer input = this->GetInput();
64 itk::ImageRegionIterator<OutputImageType> it;
65 itk::ImageRegionConstIterator<TInputImage> itIn;
67 itIn = itk::ImageRegionConstIterator<TInputImage>(input, outputRegionForThread);
68 it = itk::ImageRegionIterator<OutputImageType>(output, outputRegionForThread);
75 it.Set(
static_cast<OutputPixelType>(std::complex<typename InputPixelType::ValueType>(itIn.Get()[0], itIn.Get()[1])));
85 template <
class TInputImage,
class TOutput>
88 Superclass::PrintSelf(os, indent);
OneRIBandImageToOneComplexBandImage()
void BeforeThreadedGenerateData(void) override
OutputImageType::RegionType OutputImageRegionType
OutputImageType::PixelType OutputPixelType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.