Commit 3e07c61b authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

BUG : change default behaviour of the buffer filter to copy the input on the output

No related merge requests found
Showing with 19 additions and 4 deletions
+19 -4
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include "itkInPlaceImageFilter.h" #include "itkInPlaceImageFilter.h"
#include "otbImage.h" #include "otbImage.h"
#include "itkImageRegionIterator.h"
namespace otb namespace otb
{ {
...@@ -63,13 +65,26 @@ protected: ...@@ -63,13 +65,26 @@ protected:
InPlacePassFilter() { InPlacePassFilter() {
this->InPlaceOn(); this->InPlaceOn();
} }
~InPlacePassFilter() override {} ~InPlacePassFilter() override {}
virtual void ThreadedGenerateData( void ThreadedGenerateData(
const typename InputImageType::RegionType & const typename InputImageType::RegionType &
itkNotUsed(outputRegionForThread) , outputRegionForThread ,
itk::ThreadIdType itkNotUsed(threadId) ) override{} itk::ThreadIdType itkNotUsed(threadId) ) override
{
typename InputImageType::ConstPointer input ( this->GetInput() );
typename InputImageType::Pointer output ( this->GetOutput() );
itk::ImageRegionConstIterator < InputImageType > it ( input ,
outputRegionForThread );
itk::ImageRegionIterator < InputImageType > oit ( output ,
outputRegionForThread );
for ( oit.GoToBegin() , it.GoToBegin() ; !oit.IsAtEnd() || !it.IsAtEnd() ;
++it , ++oit )
{
oit.Set(it.Get());
}
}
private: private:
InPlacePassFilter(const Self &) = delete ; InPlacePassFilter(const Self &) = delete ;
void operator =(const Self&) = delete ; void operator =(const Self&) = delete ;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment