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

itkRealAndImaginaryToComplexImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRealAndImaginaryToComplexImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-24 19:03:15 $
00007   Version:   $Revision: 1.4 $
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 __itkRealAndImaginaryToComplexImageFilter_h
00018 #define __itkRealAndImaginaryToComplexImageFilter_h
00019 
00020 #include "itkBinaryFunctorImageFilter.h"
00021 
00022 namespace itk
00023 {
00024   
00054 namespace Functor {  
00055   
00056 template< class TInput1, class TInput2, class TOutput>
00057 class RealAndImaginaryToComplex
00058 {
00059 public:
00060   RealAndImaginaryToComplex() {};
00061   ~RealAndImaginaryToComplex() {};
00062   bool operator!=( const RealAndImaginaryToComplex & ) const
00063     {
00064     return false;
00065     }
00066   bool operator==( const RealAndImaginaryToComplex & other ) const
00067     {
00068     return !(*this != other);
00069     }
00070   inline std::complex<TOutput> operator()( const TInput1 & A, const TInput2 & B) const
00071     {
00072     return std::complex<TOutput>( static_cast<TOutput>(A), static_cast<TOutput>(B));
00073     }
00074 }; 
00075 }
00076 
00077 template <class TInputPixel1, class TInputPixel2, class TOutputPixel, unsigned int NDimension = 3>
00078 class ITK_EXPORT RealAndImaginaryToComplexImageFilter :
00079     public BinaryFunctorImageFilter<
00080        Image < TInputPixel1, NDimension >,
00081        Image < TInputPixel2, NDimension >,
00082        Image < std::complex<TOutputPixel>, NDimension >, 
00083          Functor::RealAndImaginaryToComplex< 
00084             TInputPixel1, 
00085             TInputPixel2,
00086             TOutputPixel
00087                  > >
00088 {
00089 public:
00091   typedef RealAndImaginaryToComplexImageFilter      Self;
00092   typedef BinaryFunctorImageFilter<
00093     Image < TInputPixel1, NDimension >,
00094     Image < TInputPixel2, NDimension >,
00095     Image < std::complex<TOutputPixel>, NDimension >, 
00096       Functor::RealAndImaginaryToComplex< 
00097             TInputPixel1, 
00098             TInputPixel2,
00099             TOutputPixel > >                        Superclass;
00100 
00101   typedef SmartPointer<Self>                        Pointer;
00102   typedef SmartPointer<const Self>                  ConstPointer;
00103 
00105   itkNewMacro(Self);
00106 
00108   itkTypeMacro(RealAndImaginaryToComplexImageFilter, BinaryFunctorImageFilter);
00109 
00110 #ifdef ITK_USE_CONCEPT_CHECKING
00111 
00112   itkConceptMacro(Input1ConvertibleToDoubleCheck,
00113     (Concept::Convertible<TInputPixel1, double>));
00114   itkConceptMacro(Input2ConvertibleToDoubleCheck,
00115     (Concept::Convertible<TInputPixel2, double>));
00116   itkConceptMacro(DoubleConvertibleToOutputCheck,
00117     (Concept::Convertible<double, TOutputPixel>));
00118 
00120 #endif
00121 
00122 protected:
00123   RealAndImaginaryToComplexImageFilter() {}
00124   virtual ~RealAndImaginaryToComplexImageFilter() {}
00125 
00126 private:
00127   RealAndImaginaryToComplexImageFilter(const Self&); //purposely not implemented
00128   void operator=(const Self&); //purposely not implemented
00129 
00130 };
00131 
00132 } // end namespace itk
00133 
00134 
00135 #endif
00136 

Generated at Tue Sep 15 04:32:56 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000