Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkCompose2DVectorImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCompose2DVectorImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-09-27 11:36:40 $
00007   Version:   $Revision: 1.5 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkCompose2DVectorImageFilter_h
00018 #define __itkCompose2DVectorImageFilter_h
00019 
00020 #include "itkBinaryFunctorImageFilter.h"
00021 #include "itkVector.h"
00022 
00034 namespace itk
00035 {
00036   
00037 namespace Function {  
00038   
00039 template< class TInput >
00040 class Compose2DVector
00041 {
00042 public:
00043   typedef Vector<TInput,2> OutputType;
00044   Compose2DVector() {}
00045   ~Compose2DVector() {}
00046   bool operator!=( const Compose2DVector & ) const
00047   {
00048     return false;
00049   }
00050   bool operator==( const Compose2DVector & other ) const
00051   {
00052     return !(*this != other);
00053   }
00054   inline OutputType operator()(  const TInput & s1, 
00055                                  const TInput & s2 )
00056   {
00057     OutputType v;
00058     v[0] = s1;
00059     v[1] = s2;
00060     return v;
00061   }
00062 }; 
00063 }
00064 
00065 template <typename TInputImage, 
00066           typename TOutputImage= 
00067           Image< Vector< ITK_TYPENAME TInputImage::PixelType,2 >,
00068                  ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00069 class ITK_EXPORT Compose2DVectorImageFilter :
00070     public
00071 BinaryFunctorImageFilter<TInputImage,TInputImage,
00072                           TOutputImage, 
00073                           Function::Compose2DVector< ITK_TYPENAME TInputImage::PixelType >   >
00074 {
00075 public:
00077   typedef Compose2DVectorImageFilter  Self;
00078   typedef BinaryFunctorImageFilter<TInputImage,TInputImage,
00079                                     TOutputImage, 
00080                                     Function::Compose2DVector< 
00081     ITK_TYPENAME TInputImage::PixelType > 
00082   >  Superclass;
00083   typedef SmartPointer<Self>   Pointer;
00084   typedef SmartPointer<const Self>  ConstPointer;
00085 
00086   typedef typename Superclass::OutputImageType OutputImageType;
00087   
00089   itkNewMacro(Self);
00090 
00092   itkTypeMacro(Compose2DVectorImageFilter, 
00093                BinaryFunctorImageFilter);
00094 
00095 #ifdef ITK_USE_CONCEPT_CHECKING
00096 
00097   itkConceptMacro(InputHasNumericTraitsCheck,
00098     (Concept::HasNumericTraits<typename TInputImage::PixelType>));
00099 
00101 #endif
00102 
00103 protected:
00104   Compose2DVectorImageFilter() {}
00105   virtual ~Compose2DVectorImageFilter() {}
00106 
00107 private:
00108   Compose2DVectorImageFilter(const Self&); //purposely not implemented
00109   void operator=(const Self&); //purposely not implemented
00110 
00111 
00112 };
00113 
00114 } // end namespace itk
00115 
00116 
00117 #endif
00118 

Generated at Mon Apr 14 12:02:10 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000