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

itkFFTWComplexConjugateToRealImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFFTWComplexConjugateToRealImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/08/28 19:07:17 $
00007   Version:   $Revision: 1.8 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkFFTWComplexConjugateToRealImageFilter_h
00018 #define __itkFFTWComplexConjugateToRealImageFilter_h
00019 
00020 #include "itkFFTComplexConjugateToRealImageFilter.h"
00021 
00022 //
00023 // FFTWCommon defines proxy classes based on data types
00024 #include "itkFFTWCommon.h"
00025 
00026 
00027 namespace itk
00028 {
00029 
00030 template <typename TPixel,unsigned int Dimension>
00031 class FFTWComplexConjugateToRealImageFilter :
00032     public FFTComplexConjugateToRealImageFilter<TPixel,Dimension>
00033 {
00034 public:
00035   typedef FFTWComplexConjugateToRealImageFilter Self;
00036   typedef FFTComplexConjugateToRealImageFilter<TPixel,Dimension> Superclass;
00037   typedef SmartPointer<Self> Pointer;
00038   typedef SmartPointer<const Self> constPointer;
00039   //
00040   // the proxy type is a wrapper for the fftw API
00041   // since the proxy is only defined over double and float,
00042   // trying to use any other pixel type is inoperative, as
00043   // is trying to use double if only the float FFTW version is 
00044   // configured in, or float if only double is configured.
00045   //
00046   typedef typename fftw::Proxy<TPixel> FFTWProxyType;
00047 
00049   typedef typename Superclass::TInputImageType TInputImageType;
00050   typedef typename Superclass::TOutputImageType TOutputImageType;
00051 
00053   itkNewMacro(Self);
00054 
00056   itkTypeMacro(FFTWComplexConjugateToRealImageFilter,
00057                FFTComplexConjugateToRealImageFilter);
00058 
00060   typedef TInputImageType ImageType;
00061   typedef typename ImageType::SizeType ImageSizeType;
00062 
00063   //
00064   // these should be defined in every FFT filter class
00065   virtual void GenerateData();  // generates output from input
00066   virtual bool FullMatrix();
00067 protected:
00068   FFTWComplexConjugateToRealImageFilter() : m_PlanComputed(false),
00069                                             m_LastImageSize(0),
00070                                             m_InputBuffer(0),
00071                                             m_OutputBuffer(0)
00072   {
00073   }
00074   virtual ~FFTWComplexConjugateToRealImageFilter(){
00075     if(m_PlanComputed)
00076       {
00077       FFTWProxyType::DestroyPlan(m_Plan);
00078       delete [] m_InputBuffer;
00079       delete [] m_OutputBuffer;
00080       }
00081   }
00082 
00083 private:
00084   FFTWComplexConjugateToRealImageFilter(const Self&); //purposely not implemented
00085   void operator=(const Self&); //purposely not implemented
00086   bool m_PlanComputed;
00087   typename FFTWProxyType::PlanType m_Plan;
00088   unsigned int m_LastImageSize;
00089   // local storage needed to keep fftw from scribbling on
00090   typename FFTWProxyType::ComplexType *m_InputBuffer;
00091   TPixel *m_OutputBuffer;
00092 };
00093 
00094 
00095 } // namespace itk
00096 
00097 #ifndef ITK_MANUAL_INSTANTIATION
00098 #include "itkFFTWComplexConjugateToRealImageFilter.txx"
00099 #endif
00100 
00101 #endif //__itkFFTWComplexConjugateToRealImageFilter_h
00102 

Generated at Sun Sep 23 12:33:01 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000