21 #ifndef otbUnaryFunctorVectorImageFilter_hxx
22 #define otbUnaryFunctorVectorImageFilter_hxx
25 #include "itkImageRegionIterator.h"
26 #include "itkProgressReporter.h"
34 template <
class TInputImage,
class TOutputImage,
class TFunction>
37 this->SetNumberOfRequiredInputs(1);
45 template <
class TInputImage,
class TOutputImage,
class TFunction>
48 Superclass::GenerateOutputInformation();
50 this->GetOutput()->SetNumberOfComponentsPerPixel(this->GetInput()->GetNumberOfComponentsPerPixel());
56 template <
class TInputImage,
class TOutputImage,
class TFunction>
58 itk::ThreadIdType threadId)
61 this->CallCopyOutputRegionToInputRegion(inputRegionForThread, outputRegionForThread);
64 itk::ImageRegionConstIterator<InputImageType> inputIt(this->GetInput(), inputRegionForThread);
67 itk::ImageRegionIterator<OutputImageType> outputIt(this->GetOutput(), outputRegionForThread);
71 itk::ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels());
73 while (!outputIt.IsAtEnd() && !inputIt.IsAtEnd())
75 outputIt.Set(m_Functor(inputIt.Get()));
80 progress.CompletedPixel();