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

itkComposeRGBImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkComposeRGBImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/09/27 11:36:40 $
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 __itkComposeRGBImageFilter_h
00018 #define __itkComposeRGBImageFilter_h
00019 
00020 #include "itkTernaryFunctorImageFilter.h"
00021 #include "itkRGBPixel.h"
00022 
00034 namespace itk
00035 {
00036   
00037 namespace Function {  
00038   
00039 template< class TInput >
00040 class ComposeRGB
00041 {
00042 public:
00043   typedef RGBPixel<TInput> OutputType;
00044   ComposeRGB() {}
00045   ~ComposeRGB() {}
00046   bool operator!=( const ComposeRGB & ) const
00047   {
00048     return false;
00049   }
00050   bool operator==( const ComposeRGB & other ) const
00051   {
00052     return !(*this != other);
00053   }
00054   inline OutputType operator()(  const TInput & R, 
00055                                  const TInput & G,
00056                                  const TInput & B)
00057   {
00058     OutputType rgbPixel;
00059     rgbPixel.Set( R, G, B);
00060     return rgbPixel;
00061   }
00062 }; 
00063 }
00064 
00065 template <typename TInputImage, 
00066           typename TOutputImage= 
00067           Image< RGBPixel< ITK_TYPENAME TInputImage::PixelType >,
00068                  ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00069 class ITK_EXPORT ComposeRGBImageFilter :
00070     public
00071 TernaryFunctorImageFilter<TInputImage,TInputImage,
00072                           TInputImage,TOutputImage, 
00073                           Function::ComposeRGB< ITK_TYPENAME TInputImage::PixelType >   >
00074 {
00075 public:
00077   typedef ComposeRGBImageFilter  Self;
00078   typedef TernaryFunctorImageFilter<TInputImage,TInputImage,
00079                                     TInputImage,TOutputImage, 
00080                                     Function::ComposeRGB< 
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(ComposeRGBImageFilter, 
00093                TernaryFunctorImageFilter);
00094 
00095 protected:
00096   ComposeRGBImageFilter() {}
00097   virtual ~ComposeRGBImageFilter() {}
00098 
00099 private:
00100   ComposeRGBImageFilter(const Self&); //purposely not implemented
00101   void operator=(const Self&); //purposely not implemented
00102 
00103 
00104 };
00105 
00106 } // end namespace itk
00107 
00108 
00109 #endif
00110 

Generated at Tue Jul 29 19:36:09 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000