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

itkFFTWComplexToComplexImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFFTWComplexToComplexImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2010-02-26 05:28:25 $
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 
00018 #ifndef __itkFFTWComplexToComplexImageFilter_h
00019 #define __itkFFTWComplexToComplexImageFilter_h
00020 
00021 #if defined(USE_FFTWF) || defined(USE_FFTWD)
00022 
00023 #include "itkFFTComplexToComplexImageFilter.h"
00024 #include "fftw3.h"
00025 
00026 namespace itk
00027 {
00046 template <typename TPixel,unsigned int NDimension = 3 >
00047 class FFTWComplexToComplexImageFilter:
00048     public FFTComplexToComplexImageFilter< TPixel, NDimension >
00049 {
00050 //#error Invalid Type Listed for TPixel
00051 };
00052 
00053 template <unsigned int NDimension>
00054 class FFTWComplexToComplexImageFilter<float,NDimension>:
00055     public FFTComplexToComplexImageFilter<float,NDimension>
00056 {
00057 // TODO:  There should be compile time type checks so that
00058 //        if only USE_FFTWF is defined, then only floats are valid.
00059 //        and if USE_FFTWD is defined, then only doubles are valid.
00060 public:
00061   typedef float                                       TPixel;
00062   typedef FFTWComplexToComplexImageFilter             Self;
00063   typedef FFTComplexToComplexImageFilter<
00064     TPixel,NDimension>                                Superclass;
00065   typedef SmartPointer<Self>                          Pointer;
00066   typedef SmartPointer<const Self>                    ConstPointer;
00067 
00069   typedef typename Superclass::InputImageType         InputImageType;
00070   typedef typename Superclass::OutputImageType        OutputImageType;
00071 
00073   itkNewMacro(Self);
00074 
00076   itkTypeMacro(FFTWComplexToComplexImageFilter,
00077                FFTComplexToComplexImageFilter);
00078 
00080   typedef InputImageType                          ImageType;
00081   typedef typename ImageType::SizeType            ImageSizeType;
00082 
00083 
00084 protected:
00085 
00086   FFTWComplexToComplexImageFilter()
00087     {
00088     this->m_PlanComputed= false;
00089     }
00090 
00091   virtual ~FFTWComplexToComplexImageFilter()
00092     {
00093     if(m_PlanComputed)
00094       {
00095       fftwf_destroy_plan(m_Plan);
00096       }
00097     }
00098   
00102   virtual void GenerateData();  // generates output from input
00103   virtual bool FullMatrix();
00105 
00106 
00107 private:
00108   FFTWComplexToComplexImageFilter(const Self&); //purposely not implemented
00109   void operator=(const Self&); //purposely not implemented
00110 
00111   bool            m_PlanComputed;
00112   fftwf_plan      m_Plan;
00113 };
00114 
00115 
00116 template <unsigned int NDimension>
00117 class FFTWComplexToComplexImageFilter<double,NDimension>:
00118     public FFTComplexToComplexImageFilter<double,NDimension>
00119 {
00120 // TODO:  There should be compile time type checks so that
00121 //        if only USE_FFTWF is defined, then only floats are valid.
00122 //        and if USE_FFTWD is defined, then only doubles are valid.
00123 public:
00124   typedef double                                  TPixel;
00125   typedef FFTWComplexToComplexImageFilter         Self;
00126   typedef FFTComplexToComplexImageFilter<
00127     TPixel,NDimension>                            Superclass;
00128   typedef SmartPointer<Self>                      Pointer;
00129   typedef SmartPointer<const Self>                ConstPointer;
00130 
00132   typedef typename Superclass::InputImageType     InputImageType;
00133   typedef typename Superclass::OutputImageType    OutputImageType;
00134 
00136   itkNewMacro(Self);
00137 
00139   itkTypeMacro(FFTWComplexToComplexImageFilter,
00140                FFTComplexToComplexImageFilter);
00141 
00143   typedef InputImageType                          ImageType;
00144   typedef typename ImageType::SizeType            ImageSizeType;
00145 
00146 protected:
00147 
00148   FFTWComplexToComplexImageFilter()
00149     {
00150     m_PlanComputed= false;
00151     }
00152 
00153   virtual ~FFTWComplexToComplexImageFilter()
00154     {
00155     if( this->m_PlanComputed )
00156       {
00157       fftw_destroy_plan( this->m_Plan );
00158       }
00159     }
00160 
00161   //
00162   // these should be defined in every FFT filter class
00163   virtual void GenerateData();  // generates output from input
00164   virtual bool FullMatrix();
00165 
00166 private:
00167   FFTWComplexToComplexImageFilter(const Self&); //purposely not implemented
00168   void operator=(const Self&); //purposely not implemented
00169 
00170   bool                      m_PlanComputed;
00171   fftw_plan                 m_Plan;
00172 };
00173 
00174 } // namespace itk
00175 
00176 #ifndef ITK_MANUAL_INSTANTIATION
00177 #include "itkFFTWComplexToComplexImageFilter.txx"
00178 #endif
00179 
00180 #endif // defined(USE_FFTWF) || defined(USE_FFTWD)
00181 
00182 #endif //__itkFFTWComplexToComplexImageFilter_h
00183 

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