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: 2009-04-01 14:36:10 $
00007   Version:   $Revision: 1.11 $
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 
00023 namespace itk
00024 {
00025   
00026 namespace Function {  
00027   
00028 template< class TInput >
00029 class ComposeRGB
00030 {
00031 public:
00032   typedef RGBPixel<TInput> OutputType;
00033   ComposeRGB() {}
00034   ~ComposeRGB() {}
00035   bool operator!=( const ComposeRGB & ) const
00036     {
00037     return false;
00038     }
00039   bool operator==( const ComposeRGB & other ) const
00040     {
00041     return !(*this != other);
00042     }
00043   inline OutputType operator()(  const TInput & R, 
00044                                  const TInput & G,
00045                                  const TInput & B) const
00046     {
00047     OutputType rgbPixel;
00048     rgbPixel.Set( R, G, B);
00049     return rgbPixel;
00050     }
00051 }; 
00052 }
00053 
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<
00079     TInputImage,TInputImage,
00080     TInputImage,TOutputImage, 
00081     Function::ComposeRGB< 
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(ComposeRGBImageFilter, 
00094                TernaryFunctorImageFilter);
00095 
00096 protected:
00097   ComposeRGBImageFilter() {}
00098   virtual ~ComposeRGBImageFilter() {}
00099 
00100 private:
00101   ComposeRGBImageFilter(const Self&); //purposely not implemented
00102   void operator=(const Self&); //purposely not implemented
00103 
00104 
00105 };
00106 
00107 } // end namespace itk
00108 
00109 
00110 #endif
00111 

Generated at Mon Jul 12 2010 18:05:33 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000