ANIMA  4.0
animaODFSphericalHarmonicBasis.cxx
Go to the documentation of this file.
2 
3 namespace anima
4 {
5 
7 {
8  m_LOrder = L;
9  m_SphericalHarmonics.clear();
10 
11  for (int k = 0;k <= (int)m_LOrder;k += 2)
12  for (int m = -k;m <= k;++m)
13  {
14  SphericalHarmonic tmpSH(k,m);
15  m_SphericalHarmonics.push_back(tmpSH);
16  }
17 }
18 
19 double ODFSphericalHarmonicBasis::getNthSHValueAtPosition(int k, int m, double theta, double phi)
20 {
21  std::complex <double> tmpVal = m_SphericalHarmonics[k*(k+1)/2 + m].Value(theta,phi);
22 
23  double resVal = 0;
24 
25  if (m > 0)
26  resVal = sqrt(2.0)*imag(tmpVal);
27  else if (m < 0)
28  resVal = sqrt(2.0)*real(tmpVal);
29  else
30  resVal = real(tmpVal);
31 
32  return resVal;
33 }
34 
35 } // end namespace anima
double getNthSHValueAtPosition(int k, int m, double theta, double phi)