21 #ifndef otbVectorImageToIntensityImageFilter_hxx
22 #define otbVectorImageToIntensityImageFilter_hxx
25 #include "itkImageRegionIterator.h"
26 #include "itkProgressReporter.h"
35 template <
class TInputImage,
class TOutputImage>
40 template <
class TInputImage,
class TOutputImage>
42 itk::ThreadIdType threadId)
45 InputImageConstPointerType inputPtr = this->GetInput();
46 OutputImagePointerType outputPtr = this->GetOutput();
51 InputImageRegionType inputRegionForThread;
52 this->CallCopyOutputRegionToInputRegion(inputRegionForThread, outputRegionForThread);
55 itk::ImageRegionConstIterator<InputImageType> inputIt(inputPtr, inputRegionForThread);
56 itk::ImageRegionIterator<OutputImageType> outputIt(outputPtr, outputRegionForThread);
57 itk::ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels());
62 while (!inputIt.IsAtEnd() && !outputIt.IsAtEnd())
65 InputPixelType pixel = inputIt.Get();
66 for (
unsigned int i = 0; i < pixel.Size(); ++i)
72 outputIt.Set(
static_cast<OutputPixelType
>(sum));
75 progress.CompletedPixel();