21 #ifndef otbUnaryFunctorNeighborhoodVectorImageFilter_hxx
22 #define otbUnaryFunctorNeighborhoodVectorImageFilter_hxx
25 #include "itkImageRegionIterator.h"
26 #include "itkNeighborhoodAlgorithm.h"
27 #include "itkProgressReporter.h"
35 template <
class TInputImage,
class TOutputImage,
class TFunction>
38 this->SetNumberOfRequiredInputs(1);
40 for (
unsigned int i = 0; i < InputImageDimension; ++i)
48 template <
class TInputImage,
class TOutputImage,
class TFunction>
51 Superclass::GenerateOutputInformation();
53 this->GetOutput()->SetNumberOfComponentsPerPixel(this->GetInput()->GetNumberOfComponentsPerPixel());
59 template <
class TInputImage,
class TOutputImage,
class TFunction>
61 itk::ThreadIdType threadId)
65 this->CallCopyOutputRegionToInputRegion(inputRegionForThread, outputRegionForThread);
68 itk::ZeroFluxNeumannBoundaryCondition<TInputImage> nbc;
69 neighInputIt.OverrideBoundaryCondition(&nbc);
70 neighInputIt.GoToBegin();
72 itk::ImageRegionIterator<TOutputImage> outputIt(this->GetOutput(), outputRegionForThread);
76 itk::ProgressReporter progress(
this, threadId, outputRegionForThread.GetNumberOfPixels());
78 while (!outputIt.IsAtEnd() && !neighInputIt.IsAtEnd())
80 outputIt.Set(m_Functor(neighInputIt));
85 progress.CompletedPixel();