DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkSphericalPolarFourierGenerator.h
Go to the documentation of this file.
1 
19 #ifndef __itkSphericalPolarFourierGenerator_h
20 #define __itkSphericalPolarFourierGenerator_h
21 
22 #include <itkObject.h>
23 #include <itkObjectFactory.h>
24 #include "itkDiffusionTensor.h"
25 
26 
27 namespace itk
28 {
29 
36 template<class PreciseType = double>
37 class ITK_EXPORT SphericalPolarFourierRadialGenerator : public Object
38 {
39 public:
42  typedef Object Superclass;
43  typedef SmartPointer<Self> Pointer;
44  typedef SmartPointer<const Self> ConstPointer;
45 
47  itkNewMacro(Self);
48 
50  itkTypeMacro(SphericalPolarFourierRadialGenerator, Object);
51 
52  typedef enum {
53  SPF=0, //=0
54  DSPF, // =1
55  SHORE // =2
56  } SPFType;
57 
58 
59 
60  itkSetMacro(SPFType, SPFType);
61  itkGetMacro(SPFType, SPFType);
62 
63  itkSetMacro(Scale, double );
64  itkGetMacro(Scale, double );
65 
66  itkSetMacro(N, int);
67  itkGetMacro(N, int);
68 
69  itkSetMacro(L, int);
70  itkGetMacro(L, int);
71 
72  void SetNLSPF(const int n, const int l, const SPFType spf)
73  {
74  SetN(n); SetL(l); SetSPFType(spf);
75  }
76 
77  PreciseType Evaluate(const PreciseType qrValue, const bool isFourier=false) const;
78 
79  PreciseType GetNormalizeFacotr(const bool isFourier=false) const;
80 
81 protected:
84 
86  {
87  }
88 
89  int m_N;
90  int m_L;
91  SPFType m_SPFType;
92  double m_Scale;
93 
94 private :
95  SphericalPolarFourierRadialGenerator(const Self&); //purposely not implemented
96  void operator=(const Self&); //purposely not implemented
97 };
98 
105 template<class PreciseType = double>
106 class ITK_EXPORT SphericalPolarFourierGenerator : public Object
107 {
108 public:
111  typedef Object Superclass;
112  typedef SmartPointer<Self> Pointer;
113  typedef SmartPointer<const Self> ConstPointer;
114 
116  itkNewMacro(Self);
117 
119  itkTypeMacro(SphericalPolarFourierGenerator, Object);
120 
123  typedef typename RadialType::SPFType SPFType;
124  using RadialType::SPF;
125  using RadialType::DSPF;
126  using RadialType::SHORE;
127 
128 
129  void SetN(const int n)
130  {
131  if (n!=m_Radial->GetN())
132  {
133  m_Radial->SetN(n);
134  this->Modified();
135  }
136  }
137  void SetL(const int l)
138  {
139  if (l!=m_Radial->GetL())
140  {
141  m_Radial->SetL(l);
142  this->Modified();
143  }
144  }
145 
146  int GetN() const {return m_Radial->GetN();}
147  int GetL() const {return m_Radial->GetL();}
148 
149  itkSetMacro(M, int);
150  itkGetMacro(M, int);
151 
152  void SetNLM(const int n, const int l, const int m)
153  {
154  SetN(n);
155  SetL(l);
156  SetM(m);
157  }
158 
159  void SetScale(const double scale)
160  {
161  if (scale!=m_Radial->GetScale())
162  {
163  m_Radial->SetScale(scale);
164  this->Modified();
165  }
166  }
167  double GetScale() const {return m_Radial->GetScale();}
168 
169  void SetSPFType(const SPFType model)
170  {
171  if (model!=m_Radial->GetSPFType())
172  {
173  m_Radial->SetSPFType(model);
174  this->Modified();
175  }
176  }
177  typename RadialType::SPFType GetSPFType() const {return m_Radial->GetSPFType();}
178 
179  PreciseType EvaluateRadial(const PreciseType qrValue, const bool isFourier=false) const;
180 
181  PreciseType Evaluate(const PreciseType qrValue, const PreciseType theta, const PreciseType phi, const bool isFourier=false) const;
182 
183  PreciseType GetNormalizeFacotr(const bool isFourier=false) const
184  {
185  return m_Radial->GetNormalizeFacotr(isFourier);
186  }
187 
188 protected:
191  {
192  m_Radial = RadialType::New();
193  m_M = 0;
194  }
195 
197  {
198  }
199 
200  void PrintSelf(std::ostream & os, Indent indent) const;
201 
202  RadialPointer m_Radial;
203  int m_M;
204 
205 private :
206  SphericalPolarFourierGenerator(const Self&); //purposely not implemented
207  void operator=(const Self&); //purposely not implemented
208 };
209 
210 
211 }
212 
213 // Define instantiation macro for this template.
214 #define ITK_TEMPLATE_SphericalPolarFourierRadialGenerator(_, EXPORT, x, y) namespace itk { \
215  _(2(class EXPORT SphericalPolarFourierRadialGenerator< ITK_TEMPLATE_2 x >)) \
216  namespace Templates { typedef SphericalPolarFourierRadialGenerator< ITK_TEMPLATE_2 x > SphericalPolarFourierRadialGenerator##y; } \
217  }
218 
219 #if ITK_TEMPLATE_EXPLICIT
220 # include "Templates/itkSphericalPolarFourierRadialGenerator+-.h"
221 #endif
222 
223 #define ITK_TEMPLATE_SphericalPolarFourierGenerator(_, EXPORT, x, y) namespace itk { \
224  _(2(class EXPORT SphericalPolarFourierGenerator< ITK_TEMPLATE_2 x >)) \
225  namespace Templates { typedef SphericalPolarFourierGenerator< ITK_TEMPLATE_2 x > SphericalPolarFourierGenerator##y; } \
226  }
227 
228 #if ITK_TEMPLATE_EXPLICIT
229 # include "Templates/itkSphericalPolarFourierGenerator+-.h"
230 #endif
231 
232 #if !defined(ITK_MANUAL_INSTANTIATION) && !defined(__itkSphericalPolarFourierGenerator_hxx)
234 #endif
235 
236 #endif
void SetNLM(const int n, const int l, const int m)
void SetNLSPF(const int n, const int l, const SPFType spf)
general SPF basis in radial part, SH basis in spherical part
PreciseType GetNormalizeFacotr(const bool isFourier=false) const
SphericalPolarFourierRadialGenerator< PreciseType > RadialType