forked from InsightSoftwareConsortium/ITK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
itkFFTWRealToComplexConjugateImageFilter.h
145 lines (123 loc) · 4.57 KB
/
itkFFTWRealToComplexConjugateImageFilter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: itkFFTWRealToComplexConjugateImageFilter.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Insight Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __itkFFTWRealToComplexConjugateImageFilter_h
#define __itkFFTWRealToComplexConjugateImageFilter_h
#if defined(USE_FFTWF) || defined(USE_FFTWD)
#include "itkFFTRealToComplexConjugateImageFilter.h"
#include "fftw3.h"
namespace itk
{
/** TODO: There should be compile time type checks so that
if only USE_FFTWF is defined, then only floats are valid.
and if USE_FFTWD is defined, then only doubles are valid.
*/
/** /class FFTWRealToComplexConjugateImageFilter
* /brief
*
* \ingroup
*/
template <class TPixel, unsigned int Dimension = 3>
class ITK_EXPORT FFTWRealToComplexConjugateImageFilter :
public FFTRealToComplexConjugateImageFilter<TPixel,Dimension>
{
//not a real working class.
};
template <unsigned int Dimension>
class ITK_EXPORT FFTWRealToComplexConjugateImageFilter<float,Dimension> :
public FFTRealToComplexConjugateImageFilter<float,Dimension>
{
public:
typedef float TPixel;
typedef FFTWRealToComplexConjugateImageFilter Self;
typedef FFTRealToComplexConjugateImageFilter<TPixel,Dimension> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> constPointer;
/** Standard class typedefs.*/
typedef typename Superclass::TInputImageType TInputImageType;
typedef typename Superclass::TOutputImageType TOutputImageType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(FFTWRealToComplexConjugateImageFilter,
FFTRealToComplexConjugateImageFilter);
//
// these should be defined in every FFT filter class
virtual void GenerateData(); // generates output from input
void PrintSelf(std::ostream& os,Indent indent);
protected:
FFTWRealToComplexConjugateImageFilter() {
M_PlanComputed = false;
M_PlanComputed = false;
}
~FFTWRealToComplexConjugateImageFilter()
{
if(M_PlanComputed)
{
fftwf_destroy_plan(M_plan);
}
}
void PrintSelf(std::ostream& os, Indent indent) const;
virtual bool FullMatrix();
private:
FFTWRealToComplexConjugateImageFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
bool M_PlanComputed;
fftwf_plan M_plan;
};
template <unsigned int Dimension>
class ITK_EXPORT FFTWRealToComplexConjugateImageFilter<double,Dimension> :
public FFTRealToComplexConjugateImageFilter<double,Dimension>
{
public:
typedef double TPixel;
typedef FFTWRealToComplexConjugateImageFilter Self;
typedef FFTRealToComplexConjugateImageFilter<TPixel,Dimension> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> constPointer;
/** Standard class typedefs.*/
typedef typename Superclass::TInputImageType TInputImageType;
typedef typename Superclass::TOutputImageType TOutputImageType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(FFTWRealToComplexConjugateImageFilter,
FFTRealToComplexConjugateImageFilter);
//
// these should be defined in every FFT filter class
virtual void GenerateData(); // generates output from input
void PrintSelf(std::ostream& os,Indent indent);
protected:
FFTWRealToComplexConjugateImageFilter() {
M_PlanComputed = false;
}
~FFTWRealToComplexConjugateImageFilter()
{
if(M_PlanComputed)
{
fftw_destroy_plan(M_plan);
}
}
void PrintSelf(std::ostream& os, Indent indent) const;
virtual bool FullMatrix();
private:
FFTWRealToComplexConjugateImageFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
bool M_PlanComputed;
fftw_plan M_plan;
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkFFTWRealToComplexConjugateImageFilter.txx"
#endif
#endif // defined(USE_FFTWF) || defined(USE_FFTWD)
#endif //__itkFFTWRealToComplexConjugateImageFilter_h