From b97f5d36faa590eccb7c8008ae8be54acb6849ea Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Thu, 28 Jul 2011 11:42:48 +0200 Subject: [PATCH] Add a clitk version of itkPasteImageFilter because, with itkv4, there is a new VerifyInputInformation function that prevent filter to be used with images having different physical space, while I want to do that. --- itk/clitkPasteImageFilter.h | 49 +++++++++++++++++++++++++++++++++++ itk/clitkPasteImageFilter.hxx | 26 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 itk/clitkPasteImageFilter.h create mode 100644 itk/clitkPasteImageFilter.hxx diff --git a/itk/clitkPasteImageFilter.h b/itk/clitkPasteImageFilter.h new file mode 100644 index 0000000..72550cf --- /dev/null +++ b/itk/clitkPasteImageFilter.h @@ -0,0 +1,49 @@ +/*========================================================================= + * + * COPY OF itkPasteImageFilter to remove VerifyInputInformation + * + *=========================================================================*/ + +#ifndef __clitkPasteImageFilter_h +#define __clitkPasteImageFilter_h + +#include "itkPasteImageFilter.h" + +namespace clitk +{ + using namespace itk; + + template< class TInputImage, class TSourceImage = TInputImage, class TOutputImage = TInputImage > + class ITK_EXPORT PasteImageFilter: + public itk::PasteImageFilter< TInputImage, TSourceImage, TOutputImage > + { + public: + virtual void VerifyInputInformation() { } + + /** Standard class typedefs. */ + typedef PasteImageFilter Self; + typedef InPlaceImageFilter< TInputImage, TOutputImage > Superclass; + typedef SmartPointer< Self > Pointer; + typedef SmartPointer< const Self > ConstPointer; + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + /** Run-time type information (and related methods). */ + itkTypeMacro(PasteImageFilter, InPlaceImageFilter); + + protected: + PasteImageFilter(); + ~PasteImageFilter() {} + + private: + PasteImageFilter(const Self &); //purposely not implemented + void operator=(const Self &); //purposely not implemented + }; +} // end namespace itk + +#ifndef ITK_MANUAL_INSTANTIATION +#include "clitkPasteImageFilter.hxx" +#endif + +#endif diff --git a/itk/clitkPasteImageFilter.hxx b/itk/clitkPasteImageFilter.hxx new file mode 100644 index 0000000..348d858 --- /dev/null +++ b/itk/clitkPasteImageFilter.hxx @@ -0,0 +1,26 @@ +/*========================================================================= + * + * COPY OF itkPasteImageFilter to remove VerifyInputInformation + * + *=========================================================================*/ + +#ifndef __clitkPasteImageFilter_hxx +#define __clitkPasteImageFilter_hxx + +#include "itkPasteImageFilter.h" + +namespace clitk +{ + template< class TInputImage, class TSourceImage, class TOutputImage > + PasteImageFilter< TInputImage, TSourceImage, TOutputImage > + ::PasteImageFilter() + { + this->ProcessObject::SetNumberOfRequiredInputs(2); + + this->InPlaceOff(); + this->m_DestinationIndex.Fill(0); + } + +} // end namespace clitk + +#endif -- 2.45.1