13 std::complex <double> tmpVal;
15 for (
int k = 0;k <= (int)m_LOrder;k += 2)
16 for (
int m = -k;m <= k;++m)
18 tmpVal = m_SphericalHarmonics[k*(k+1)/2 + m].Value(theta,phi);
21 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*imag(tmpVal);
23 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*real(tmpVal);
25 resVal += coefficients[k*(k+1)/2 + m]*real(tmpVal);
32 itk::VariableLengthVector <T>
35 std::vector < std::vector <double> > &m_SampleDirections)
37 itk::VariableLengthVector <T> resVal(m_SampleDirections.size());
39 for (
unsigned int i = 0;i < m_SampleDirections.size();++i)
40 resVal[i] = this->
getValueAtPosition(data,m_SampleDirections[i][0],m_SampleDirections[i][1]);
51 std::complex <double> tmpVal;
53 for (
int k = 0;k <= (int)m_LOrder;k += 2)
54 for (
int m = -k;m <= k;++m)
56 tmpVal = m_SphericalHarmonics[k*(k+1)/2 + m].getThetaFirstDerivative(theta,phi);
59 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*imag(tmpVal);
61 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*real(tmpVal);
63 resVal += coefficients[k*(k+1)/2 + m]*real(tmpVal);
75 std::complex <double> tmpVal;
77 for (
int k = 0;k <= (int)m_LOrder;k += 2)
78 for (
int m = -k;m <= k;++m)
80 tmpVal = m_SphericalHarmonics[k*(k+1)/2 + m].getPhiFirstDerivative(theta,phi);
83 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*imag(tmpVal);
85 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*real(tmpVal);
87 resVal += coefficients[k*(k+1)/2 + m]*real(tmpVal);
99 std::complex <double> tmpVal;
101 for (
int k = 0;k <= (int)m_LOrder;k += 2)
102 for (
int m = -k;m <= k;++m)
104 tmpVal = m_SphericalHarmonics[k*(k+1)/2 + m].getThetaSecondDerivative(theta,phi);
107 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*imag(tmpVal);
109 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*real(tmpVal);
111 resVal += coefficients[k*(k+1)/2 + m]*real(tmpVal);
123 std::complex <double> tmpVal;
125 for (
int k = 0;k <= (int)m_LOrder;k += 2)
126 for (
int m = -k;m <= k;++m)
128 tmpVal = m_SphericalHarmonics[k*(k+1)/2 + m].getThetaPhiDerivative(theta,phi);
131 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*imag(tmpVal);
133 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*real(tmpVal);
135 resVal += coefficients[k*(k+1)/2 + m]*real(tmpVal);
147 std::complex <double> tmpVal;
149 for (
int k = 0;k <= (int)m_LOrder;k += 2)
150 for (
int m = -k;m <= k;++m)
152 tmpVal = m_SphericalHarmonics[k*(k+1)/2 + m].getPhiSecondDerivative(theta,phi);
155 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*imag(tmpVal);
157 resVal += coefficients[k*(k+1)/2 + m]*sqrt(2.0)*real(tmpVal);
159 resVal += coefficients[k*(k+1)/2 + m]*real(tmpVal);
172 double sqSinTheta = sin(theta) * sin(theta);
173 if (sqSinTheta <= 1.0e-16)
174 sqSinTheta = 1.0e-16;
176 double denom = 2.0 * odfValue * odfValue * sqSinTheta;
178 double num = 2.0 * odfValue * sqSinTheta;
double getCurvatureAtPosition(const T &coefficients, double theta, double phi)
double getThetaSecondDerivativeValueAtPosition(const T &coefficients, double theta, double phi)
double getThetaFirstDerivativeValueAtPosition(const T &coefficients, double theta, double phi)
double getPhiSecondDerivativeValueAtPosition(const T &coefficients, double theta, double phi)
double getThetaPhiDerivativeValueAtPosition(const T &coefficients, double theta, double phi)
itk::VariableLengthVector< T > GetSampleValues(itk::VariableLengthVector< T > &data, std::vector< std::vector< double > > &m_SampleDirections)
double getValueAtPosition(const T &coefficients, double theta, double phi)
double getPhiFirstDerivativeValueAtPosition(const T &coefficients, double theta, double phi)