22 #ifndef __SummingFilter_hxx
23 #define __SummingFilter_hxx
26 #include "itkProgressReporter.h"
34 template <
class TInputImage,
class TOutputImage>
37 itkDebugMacro(<<
"Generate output information");
38 Superclass::GenerateOutputInformation();
45 template <
class TInputImage,
class TOutputImage>
50 itkDebugMacro(<<
"Actually executing thread " << threadId <<
" in region " << outputRegionForThread);
53 itk::ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels());
59 unsigned int nbInputImages = this->GetNumberOfInputs();
60 unsigned int nbInputBands;
63 for (
unsigned int i = 0; i < nbInputImages; i++)
67 nbInputBands = currentImage->GetNumberOfComponentsPerPixel();
71 pix.SetSize(nbInputBands);
74 for (outputIt.GoToBegin(); !outputIt.IsAtEnd(); ++outputIt)
77 for (
unsigned int i = 0; i < nbInputImages; i++)
80 for (
unsigned int band = 0; band < nbInputBands; band++)
82 pix[band] += inputIt[i].Get()[band];
89 progress.CompletedPixel();