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: 2009-04-01 14:36:10 $
00007   Version:   $Revision: 1.8 $
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 
00023 namespace itk
00024 {
00025   
00026 namespace Function {  
00027   
00028 template< class TInput >
00029 class Compose2DVector
00030 {
00031 public:
00032   typedef Vector<TInput,2> OutputType;
00033   Compose2DVector() {}
00034   ~Compose2DVector() {}
00035   bool operator!=( const Compose2DVector & ) const
00036     {
00037     return false;
00038     }
00039   bool operator==( const Compose2DVector & other ) const
00040     {
00041     return !(*this != other);
00042     }
00043   inline OutputType operator()(  const TInput & s1, 
00044                                  const TInput & s2 ) const
00045     {
00046     OutputType v;
00047     v[0] = s1;
00048     v[1] = s2;
00049     return v;
00050     }
00051 }; 
00052 }
00053 
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<
00079     TInputImage,TInputImage,
00080     TOutputImage, 
00081     Function::Compose2DVector< 
00082       ITK_TYPENAME TInputImage::PixelType > >
00083                                       Superclass;
00084   typedef SmartPointer<Self>          Pointer;
00085   typedef SmartPointer<const Self>    ConstPointer;
00086 
00087   typedef typename Superclass::OutputImageType OutputImageType;
00088   
00090   itkNewMacro(Self);
00091 
00093   itkTypeMacro(Compose2DVectorImageFilter, 
00094                BinaryFunctorImageFilter);
00095 
00096 #ifdef ITK_USE_CONCEPT_CHECKING
00097 
00098   itkConceptMacro(InputHasNumericTraitsCheck,
00099     (Concept::HasNumericTraits<typename TInputImage::PixelType>));
00100 
00102 #endif
00103 
00104 protected:
00105   Compose2DVectorImageFilter() {}
00106   virtual ~Compose2DVectorImageFilter() {}
00107 
00108 private:
00109   Compose2DVectorImageFilter(const Self&); //purposely not implemented
00110   void operator=(const Self&); //purposely not implemented
00111 
00112 
00113 };
00114 
00115 } // end namespace itk
00116 
00117 
00118 #endif
00119 

Generated at Fri Apr 16 18:06:19 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000