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>
45 template <
class TInputImage,
class TOutputImage>
48 if (this->GetInput()->GetNumberOfComponentsPerPixel() != 2)
49 itkExceptionMacro(
"Input image must be made of two bands and only two.");
55 template <
class TInputImage,
class TOutputImage>
57 itk::ThreadIdType threadId)
61 itk::ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels());
63 typename OutputImageType::Pointer output = this->GetOutput();
64 typename InputImageType::ConstPointer input = this->GetInput();
66 itk::ImageRegionIterator<OutputImageType> it;
67 itk::ImageRegionConstIterator<TInputImage> itIn;
69 itIn = itk::ImageRegionConstIterator<TInputImage>(input, outputRegionForThread);
70 it = itk::ImageRegionIterator<OutputImageType>(output, outputRegionForThread);
77 it.Set(
static_cast<OutputPixelType>(std::complex<typename InputPixelType::ValueType>(itIn.Get()[0], itIn.Get()[1])));
81 progress.CompletedPixel();
88 template <
class TInputImage,
class TOutput>
91 Superclass::PrintSelf(os, indent);