From 53af3c4dbf8941d72240ed8a6cfa4b4f1c29c7e9 Mon Sep 17 00:00:00 2001
From: Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Date: Thu, 5 Feb 2009 16:39:08 +0100
Subject: [PATCH] BUG : back to farmer version : streaming pb

---
 ...bUnaryFunctorNeighborhoodWithOffsetImageFilter.txx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.txx b/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.txx
index b5520b9e81..4476bad014 100644
--- a/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.txx
+++ b/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.txx
@@ -153,7 +153,12 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, TOutputImage, TFuncti
   // support progress methods/callbacks
   itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels());
 
-  for (fit=faceList.begin(), fitOff=faceListOff.begin(); fit != faceList.end(), fitOff != faceListOff.end(); ++fit, ++fitOff)
+  // Process each of the boundary faces.  These are N-d regions which border
+  // the edge of the buffer.
+  fit=faceList.begin();
+  fitOff=faceList.begin();
+
+  while (fit!=faceList.end() && fitOff!=faceListOff.end())
   {
     // neighborhood iterator
     neighInputIt = itk::ConstNeighborhoodIterator<TInputImage>(r, inputPtr, *fit);
@@ -165,8 +170,10 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, TOutputImage, TFuncti
     neighInputOffIt.GoToBegin();
 
     outputIt = itk::ImageRegionIterator<TOutputImage>(outputPtr, *fit);
+
     while ( ! outputIt.IsAtEnd() )
     {
+
       outputIt.Set( m_FunctorList[threadId]( neighInputIt, neighInputOffIt) );
 
       ++neighInputIt;
@@ -174,6 +181,8 @@ UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, TOutputImage, TFuncti
       ++outputIt;
       progress.CompletedPixel();
     }
+    ++fit;
+    ++fitOff;
   }
 }
 
-- 
GitLab