Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkImageFourierFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageFourierFilter.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00024 #ifndef __vtkImageFourierFilter_h
00025 #define __vtkImageFourierFilter_h
00026 
00027 
00028 #include "vtkImageDecomposeFilter.h"
00029 
00030 
00031 //BTX
00032 /*******************************************************************
00033                         COMPLEX number stuff
00034 *******************************************************************/
00035 
00036 
00037 typedef struct{
00038     double Real;
00039     double Imag;
00040   } vtkImageComplex;
00041 
00042 
00043 #define vtkImageComplexEuclidSet(C, R, I) \
00044   (C).Real = (R); \
00045   (C).Imag = (I)
00046 
00047 #define vtkImageComplexPolarSet(C, M, P) \
00048   (C).Real = (M)*cos(P); \
00049   (C).Imag = (M)*sin(P)
00050 
00051 #define vtkImageComplexPrint(C) \
00052   printf("(%.3f, %.3f)", (C).Real, (C).Imag)
00053 
00054 #define vtkImageComplexScale(cOut, S, cIn) \
00055   (cOut).Real = (cIn).Real * (S); \
00056   (cOut).Imag = (cIn).Imag * (S)
00057 
00058 #define vtkImageComplexConjugate(cIn, cOut) \
00059   (cOut).Imag = (cIn).Imag * -1.0;    \
00060   (cOut).Real = (cIn).Real
00061 
00062 #define vtkImageComplexAdd(C1, C2, cOut) \
00063   (cOut).Real = (C1).Real + (C2).Real; \
00064   (cOut).Imag = (C1).Imag + (C2).Imag
00065 
00066 #define vtkImageComplexSubtract(C1, C2, cOut) \
00067   (cOut).Real = (C1).Real - (C2).Real; \
00068   (cOut).Imag = (C1).Imag - (C2).Imag
00069 
00070 #define vtkImageComplexMultiply(C1, C2, cOut) \
00071 { \
00072   vtkImageComplex _vtkImageComplexMultiplyTemp; \
00073   _vtkImageComplexMultiplyTemp.Real = (C1).Real*(C2).Real-(C1).Imag*(C2).Imag;\
00074   _vtkImageComplexMultiplyTemp.Imag = (C1).Real*(C2).Imag+(C1).Imag*(C2).Real;\
00075   cOut = _vtkImageComplexMultiplyTemp; \
00076 }
00077 
00078 // This macro calculates exp(cIn) and puts the result in cOut 
00079 #define vtkImageComplexExponential(cIn, cOut) \
00080 { \
00081   double tmp = exp(cIn.Real); \
00082   cOut.Real = tmp * cos(cIn.Imag); \
00083   cOut.Imag = tmp * sin(cIn.Imag); \
00084 }
00085 
00086 /******************* End of COMPLEX number stuff ********************/
00087 //ETX
00088 
00089 class VTK_IMAGING_EXPORT vtkImageFourierFilter : public vtkImageDecomposeFilter
00090 {
00091 public:
00092   vtkTypeRevisionMacro(vtkImageFourierFilter,vtkImageDecomposeFilter);
00093   
00094   
00095   // public for templated functions of this object
00096   //BTX
00097 
00100   void ExecuteFft(vtkImageComplex *in, vtkImageComplex *out, int N);
00101 
00102 
00105   void ExecuteRfft(vtkImageComplex *in, vtkImageComplex *out, int N);
00106 
00107   //ETX
00108   
00109 protected:
00110   vtkImageFourierFilter() {};
00111   ~vtkImageFourierFilter() {};
00112 
00113   //BTX
00114   void ExecuteFftStep2(vtkImageComplex *p_in, vtkImageComplex *p_out, 
00115                        int N, int bsize, int fb);
00116   void ExecuteFftStepN(vtkImageComplex *p_in, vtkImageComplex *p_out,
00117                        int N, int bsize, int n, int fb);
00118   void ExecuteFftForwardBackward(vtkImageComplex *in, vtkImageComplex *out, 
00119                                  int N, int fb);
00120   //ETX
00121 private:
00122   vtkImageFourierFilter(const vtkImageFourierFilter&);  // Not implemented.
00123   void operator=(const vtkImageFourierFilter&);  // Not implemented.
00124 };
00125 
00126 
00127 
00128 #endif
00129 
00130 

Generated on Mon Jan 21 23:07:29 2008 for VTK by  doxygen 1.4.3-20050530