diff --git a/Code/BasicFilters/otbStreamingCompareImageFilter.h b/Code/BasicFilters/otbStreamingCompareImageFilter.h index d88a014499ddaf92b319e776a1345ca582b11d1c..e1d1aedbf502e0c207b34a5e718d89c3332d43c5 100644 --- a/Code/BasicFilters/otbStreamingCompareImageFilter.h +++ b/Code/BasicFilters/otbStreamingCompareImageFilter.h @@ -121,6 +121,9 @@ public: RealObjectType* GetMAEOutput(); const RealObjectType* GetMAEOutput() const; + itkGetMacro(PhysicalSpaceCheck,bool); + itkSetMacro(PhysicalSpaceCheck,bool); + /** Make a DataObject of the correct type to be used as the specified * output. */ virtual DataObjectPointer MakeOutput(unsigned int idx); @@ -143,6 +146,11 @@ protected: outputRegionForThread, itk::ThreadIdType threadId); + /** Allows to skip the verification of physical space between + * the two input images (see flag m_PhysicalSpaceCheck) + */ + virtual void VerifyInputInformation(); + private: PersistentCompareImageFilter(const Self &); //purposely not implemented void operator =(const Self&); //purposely not implemented @@ -152,6 +160,7 @@ private: itk::Array<PixelType> m_ThreadMinRef; itk::Array<PixelType> m_ThreadMaxRef; itk::Array<long> m_Count; + bool m_PhysicalSpaceCheck; }; // end of class PersistentCompareImageFilter /*===========================================================================*/ @@ -264,6 +273,18 @@ public: return this->GetFilter()->GetMAEOutput(); } + /** Set the PhysicalSpaceCheck flag */ + void SetPhysicalSpaceCheck(bool flag) + { + this->GetFilter()->SetPhysicalSpaceCheck(flag); + } + + /** Get the PhysicalSpaceCheck flag */ + bool GetPhysicalSpaceCheck() + { + return this->GetFilter()->GetPhysicalSpaceCheck(); + } + protected: /** Constructor */ StreamingCompareImageFilter() {}; diff --git a/Code/BasicFilters/otbStreamingCompareImageFilter.txx b/Code/BasicFilters/otbStreamingCompareImageFilter.txx index 5ae411f21111bd05278e73a6ec0ce34251494d82..ecf4a0596c1474398894264429e470ff1ceb76bf 100644 --- a/Code/BasicFilters/otbStreamingCompareImageFilter.txx +++ b/Code/BasicFilters/otbStreamingCompareImageFilter.txx @@ -31,7 +31,7 @@ namespace otb template<class TInputImage> PersistentCompareImageFilter<TInputImage> ::PersistentCompareImageFilter() : m_SquareOfDifferences(1), m_AbsoluteValueOfDifferences(1), - m_ThreadMinRef(1), m_ThreadMaxRef(1), m_Count(1) + m_ThreadMinRef(1), m_ThreadMaxRef(1), m_Count(1), m_PhysicalSpaceCheck(true) { this->SetNumberOfRequiredInputs( 2 ); // first output is a copy of the image, DataObject created by @@ -275,6 +275,15 @@ PersistentCompareImageFilter<TInputImage> m_ThreadMaxRef.Fill(itk::NumericTraits<PixelType>::NonpositiveMin()); } +template<class TInputImage> +void +PersistentCompareImageFilter<TInputImage> +::VerifyInputInformation() +{ + if (m_PhysicalSpaceCheck) + Superclass::VerifyInputInformation(); +} + template<class TInputImage> void PersistentCompareImageFilter<TInputImage>