From: David Sarrut Date: Thu, 28 Jul 2011 09:42:48 +0000 (+0200) Subject: Add a clitk version of itkPasteImageFilter because, with itkv4, there is a new Verify... X-Git-Tag: v1.3.0~257 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b97f5d36faa590eccb7c8008ae8be54acb6849ea;p=clitk.git 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. --- 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