OpenWalnut
1.4.0
|
Class for symmetric spherical harmonics The index scheme of the coefficients/basis values is like in the Descoteaux paper "Regularized, Fast, and Robust Analytical Q-Ball Imaging". More...
#include <WSymmetricSphericalHarmonic.h>
Public Member Functions | |
WSymmetricSphericalHarmonic () | |
Default constructor. | |
WSymmetricSphericalHarmonic (const WValue< T > &SHCoefficients) | |
Constructor. | |
virtual | ~WSymmetricSphericalHarmonic () |
Destructor. | |
T | getValue (T theta, T phi) const |
Return the value on the sphere. | |
T | getValue (const WUnitSphereCoordinates< T > &coordinates) const |
Return the value on the sphere. | |
const WValue< T > & | getCoefficients () const |
Returns the used coefficients (stored like in the mentioned 2007 Descoteaux paper). | |
WValue< T > | getCoefficientsSchultz () const |
Returns the coefficients for Schultz' SH base. | |
WValue< std::complex< T > > | getCoefficientsComplex () const |
Returns the coefficients for the complex base. | |
void | applyFunkRadonTransformation (WMatrix< T > const &frtMat) |
Applies the Funk-Radon-Transformation. | |
size_t | getOrder () const |
Return the order of the spherical harmonic. | |
T | calcGFA (std::vector< WUnitSphereCoordinates< T > > const &orientations) const |
Calculate the generalized fractional anisotropy for this ODF. | |
T | calcGFA (WMatrix< T > const &B) const |
Calculate the generalized fractional anisotropy for this ODF. | |
void | normalize () |
Normalize this SH in place. | |
Static Public Member Functions | |
static WMatrix< T > | getSHFittingMatrix (const std::vector< WMatrixFixed< T, 3, 1 > > &orientations, int order, T lambda, bool withFRT) |
This calculates the transformation/fitting matrix T like in the 2007 Descoteaux paper. | |
static WMatrix< T > | getSHFittingMatrix (const std::vector< WUnitSphereCoordinates< T > > &orientations, int order, T lambda, bool withFRT) |
This calculates the transformation/fitting matrix T like in the 2007 Descoteaux paper. | |
static WMatrix< T > | getSHFittingMatrixForConstantSolidAngle (const std::vector< WMatrixFixed< T, 3, 1 > > &orientations, int order, T lambda) |
This calculates the transformation/fitting matrix T like in the 2010 Aganj paper. | |
static WMatrix< T > | getSHFittingMatrixForConstantSolidAngle (const std::vector< WUnitSphereCoordinates< T > > &orientations, int order, T lambda) |
This calculates the transformation/fitting matrix T like in the 2010 Aganj paper. | |
static WMatrix< T > | calcBaseMatrix (const std::vector< WUnitSphereCoordinates< T > > &orientations, int order) |
Calculates the base matrix B like in the dissertation of Descoteaux. | |
static WMatrix< std::complex< T > > | calcComplexBaseMatrix (std::vector< WUnitSphereCoordinates< T > > const &orientations, int order) |
Calculates the base matrix B for the complex spherical harmonics. | |
static WValue< T > | calcEigenvalues (size_t order) |
Calc eigenvalues for SH elements. | |
static WMatrix< T > | calcMatrixWithEigenvalues (size_t order) |
Calc matrix with the eigenvalues of the SH elements on its diagonal. | |
static WMatrix< T > | calcSmoothingMatrix (size_t order) |
This calcs the smoothing matrix L from the 2007 Descoteaux Paper "Regularized, Fast, and Robust Analytical Q-Ball Imaging". | |
static WMatrix< T > | calcFRTMatrix (size_t order) |
Calculates the Funk-Radon-Transformation-Matrix P from the 2007 Descoteaux Paper "Regularized, Fast, and Robust Analytical Q-Ball Imaging". | |
static WMatrix< T > | calcSHToTensorSymMatrix (std::size_t order) |
Calculates a matrix that converts spherical harmonics to symmetric tensors of equal or lower order. | |
static WMatrix< T > | calcSHToTensorSymMatrix (std::size_t order, const std::vector< WUnitSphereCoordinates< T > > &orientations) |
Calculates a matrix that converts spherical harmonics to symmetric tensors of equal or lower order. | |
Private Attributes | |
size_t | m_order |
order of the spherical harmonic | |
WValue< T > | m_SHCoefficients |
coefficients of the spherical harmonic |
Class for symmetric spherical harmonics The index scheme of the coefficients/basis values is like in the Descoteaux paper "Regularized, Fast, and Robust Analytical Q-Ball Imaging".
Definition at line 51 of file WSymmetricSphericalHarmonic.h.
WSymmetricSphericalHarmonic< T >::WSymmetricSphericalHarmonic | ( | ) |
Default constructor.
Definition at line 279 of file WSymmetricSphericalHarmonic.h.
WSymmetricSphericalHarmonic< T >::WSymmetricSphericalHarmonic | ( | const WValue< T > & | SHCoefficients | ) | [explicit] |
Constructor.
SHCoefficients | the initial coefficients (stored like in the mentioned Descoteaux paper). |
Definition at line 286 of file WSymmetricSphericalHarmonic.h.
References WSymmetricSphericalHarmonic< T >::m_order, and WSymmetricSphericalHarmonic< T >::m_SHCoefficients.
WSymmetricSphericalHarmonic< T >::~WSymmetricSphericalHarmonic | ( | ) | [virtual] |
Destructor.
Definition at line 296 of file WSymmetricSphericalHarmonic.h.
void WSymmetricSphericalHarmonic< T >::applyFunkRadonTransformation | ( | WMatrix< T > const & | frtMat | ) |
Applies the Funk-Radon-Transformation.
This is faster than matrix multiplication. ( O(n) instead of O(n²) )
frtMat | the frt matrix as calculated by calcFRTMatrix() |
Definition at line 491 of file WSymmetricSphericalHarmonic.h.
References WMatrix< T >::getNbCols(), and WMatrix< T >::getNbRows().
WMatrix< T > WSymmetricSphericalHarmonic< T >::calcBaseMatrix | ( | const std::vector< WUnitSphereCoordinates< T > > & | orientations, |
int | order | ||
) | [static] |
Calculates the base matrix B like in the dissertation of Descoteaux.
orientations | The vector with the used orientation on the unit sphere (usually the gradients of the HARDI) |
order | The order of the spherical harmonics intended to create |
Definition at line 601 of file WSymmetricSphericalHarmonic.h.
WMatrix< std::complex< T > > WSymmetricSphericalHarmonic< T >::calcComplexBaseMatrix | ( | std::vector< WUnitSphereCoordinates< T > > const & | orientations, |
int | order | ||
) | [static] |
Calculates the base matrix B for the complex spherical harmonics.
orientations | The vector with the used orientation on the unit sphere (usually the gradients of the HARDI) |
order | The order of the spherical harmonics intended to create |
Definition at line 637 of file WSymmetricSphericalHarmonic.h.
WValue< T > WSymmetricSphericalHarmonic< T >::calcEigenvalues | ( | size_t | order | ) | [static] |
Calc eigenvalues for SH elements.
order | The order of the spherical harmonic |
Definition at line 667 of file WSymmetricSphericalHarmonic.h.
WMatrix< T > WSymmetricSphericalHarmonic< T >::calcFRTMatrix | ( | size_t | order | ) | [static] |
Calculates the Funk-Radon-Transformation-Matrix P from the 2007 Descoteaux Paper "Regularized, Fast, and Robust Analytical Q-Ball Imaging".
order | The order of the spherical harmonic |
Definition at line 708 of file WSymmetricSphericalHarmonic.h.
T WSymmetricSphericalHarmonic< T >::calcGFA | ( | std::vector< WUnitSphereCoordinates< T > > const & | orientations | ) | const |
Calculate the generalized fractional anisotropy for this ODF.
See: David S. Tuch, "Q-Ball Imaging", Magn. Reson. Med. 52, 2004, 1358-1372
orientations | A vector of unit sphere coordinates. |
Definition at line 395 of file WSymmetricSphericalHarmonic.h.
T WSymmetricSphericalHarmonic< T >::calcGFA | ( | WMatrix< T > const & | B | ) | const |
Calculate the generalized fractional anisotropy for this ODF.
This version of the function uses precomputed base functions (because calculating the base function values is rather expensive). Use this version if you want to compute the GFA for multiple ODFs with the same base functions. The base function Matrix can be computed using
See: David S. Tuch, "Q-Ball Imaging", Magn. Reson. Med. 52, 2004, 1358-1372
B | The matrix of SH base functions. |
Definition at line 439 of file WSymmetricSphericalHarmonic.h.
References WMatrix< T >::getNbCols(), and WMatrix< T >::getNbRows().
WMatrix< T > WSymmetricSphericalHarmonic< T >::calcMatrixWithEigenvalues | ( | size_t | order | ) | [static] |
Calc matrix with the eigenvalues of the SH elements on its diagonal.
order | The order of the spherical harmonic |
Definition at line 684 of file WSymmetricSphericalHarmonic.h.
References WValue< T >::size().
WMatrix< T > WSymmetricSphericalHarmonic< T >::calcSHToTensorSymMatrix | ( | std::size_t | order | ) | [static] |
Calculates a matrix that converts spherical harmonics to symmetric tensors of equal or lower order.
order | The order of the symmetric tensor. |
Definition at line 727 of file WSymmetricSphericalHarmonic.h.
WMatrix< T > WSymmetricSphericalHarmonic< T >::calcSHToTensorSymMatrix | ( | std::size_t | order, |
const std::vector< WUnitSphereCoordinates< T > > & | orientations | ||
) | [static] |
Calculates a matrix that converts spherical harmonics to symmetric tensors of equal or lower order.
order | The order of the symmetric tensor. |
orientations | A vector of at least (orderTensor+1) * (orderTensor+2) / 2 orientations. |
Definition at line 747 of file WSymmetricSphericalHarmonic.h.
WMatrix< T > WSymmetricSphericalHarmonic< T >::calcSmoothingMatrix | ( | size_t | order | ) | [static] |
This calcs the smoothing matrix L from the 2007 Descoteaux Paper "Regularized, Fast, and Robust Analytical Q-Ball Imaging".
order | The order of the spherical harmonic |
Definition at line 696 of file WSymmetricSphericalHarmonic.h.
References WValue< T >::size().
const WValue< T > & WSymmetricSphericalHarmonic< T >::getCoefficients | ( | ) | const |
Returns the used coefficients (stored like in the mentioned 2007 Descoteaux paper).
Definition at line 334 of file WSymmetricSphericalHarmonic.h.
WValue< std::complex< T > > WSymmetricSphericalHarmonic< T >::getCoefficientsComplex | ( | ) | const |
Returns the coefficients for the complex base.
Definition at line 364 of file WSymmetricSphericalHarmonic.h.
WValue< T > WSymmetricSphericalHarmonic< T >::getCoefficientsSchultz | ( | ) | const |
Returns the coefficients for Schultz' SH base.
Definition at line 340 of file WSymmetricSphericalHarmonic.h.
size_t WSymmetricSphericalHarmonic< T >::getOrder | ( | ) | const |
Return the order of the spherical harmonic.
Definition at line 503 of file WSymmetricSphericalHarmonic.h.
WMatrix< T > WSymmetricSphericalHarmonic< T >::getSHFittingMatrix | ( | const std::vector< WMatrixFixed< T, 3, 1 > > & | orientations, |
int | order, | ||
T | lambda, | ||
bool | withFRT | ||
) | [static] |
This calculates the transformation/fitting matrix T like in the 2007 Descoteaux paper.
The orientations are given as WMatrixFixed< T, 3, 1 >.
orientations | The vector with the used orientation on the unit sphere (usually the gradients of the HARDI) |
order | The order of the spherical harmonics intended to create |
lambda | Regularization parameter for smoothing matrix |
withFRT | include the Funk-Radon-Transformation? |
Definition at line 509 of file WSymmetricSphericalHarmonic.h.
WMatrix< T > WSymmetricSphericalHarmonic< T >::getSHFittingMatrix | ( | const std::vector< WUnitSphereCoordinates< T > > & | orientations, |
int | order, | ||
T | lambda, | ||
bool | withFRT | ||
) | [static] |
This calculates the transformation/fitting matrix T like in the 2007 Descoteaux paper.
The orientations are given as WUnitSphereCoordinates< T >.
orientations | The vector with the used orientation on the unit sphere (usually the gradients of the HARDI) |
order | The order of the spherical harmonics intended to create |
lambda | Regularization parameter for smoothing matrix |
withFRT | include the Funk-Radon-Transformation? |
Definition at line 524 of file WSymmetricSphericalHarmonic.h.
References WMatrix< T >::transposed().
WMatrix< T > WSymmetricSphericalHarmonic< T >::getSHFittingMatrixForConstantSolidAngle | ( | const std::vector< WMatrixFixed< T, 3, 1 > > & | orientations, |
int | order, | ||
T | lambda | ||
) | [static] |
This calculates the transformation/fitting matrix T like in the 2010 Aganj paper.
The orientations are given as WUnitSphereCoordinates< T >.
orientations | The vector with the used orientation on the unit sphere (usually the gradients of the HARDI) |
order | The order of the spherical harmonics intended to create |
lambda | Regularization parameter for smoothing matrix |
Definition at line 548 of file WSymmetricSphericalHarmonic.h.
WMatrix< T > WSymmetricSphericalHarmonic< T >::getSHFittingMatrixForConstantSolidAngle | ( | const std::vector< WUnitSphereCoordinates< T > > & | orientations, |
int | order, | ||
T | lambda | ||
) | [static] |
This calculates the transformation/fitting matrix T like in the 2010 Aganj paper.
The orientations are given as WUnitSphereCoordinates< T >.
orientations | The vector with the used orientation on the unit sphere (usually the gradients of the HARDI) |
order | The order of the spherical harmonics intended to create |
lambda | Regularization parameter for smoothing matrix |
Definition at line 562 of file WSymmetricSphericalHarmonic.h.
References wlog::debug(), and WMatrix< T >::transposed().
T WSymmetricSphericalHarmonic< T >::getValue | ( | T | theta, |
T | phi | ||
) | const |
Return the value on the sphere.
theta | angle for the position on the unit sphere |
phi | angle for the position on the unit sphere |
Definition at line 301 of file WSymmetricSphericalHarmonic.h.
T WSymmetricSphericalHarmonic< T >::getValue | ( | const WUnitSphereCoordinates< T > & | coordinates | ) | const |
Return the value on the sphere.
coordinates | for the position on the unit sphere |
Definition at line 328 of file WSymmetricSphericalHarmonic.h.
References WUnitSphereCoordinates< T >::getPhi(), and WUnitSphereCoordinates< T >::getTheta().
void WSymmetricSphericalHarmonic< T >::normalize | ( | ) |
Normalize this SH in place.
Definition at line 802 of file WSymmetricSphericalHarmonic.h.
size_t WSymmetricSphericalHarmonic< T >::m_order [private] |
order of the spherical harmonic
Definition at line 272 of file WSymmetricSphericalHarmonic.h.
Referenced by WSymmetricSphericalHarmonic< T >::WSymmetricSphericalHarmonic().
WValue< T > WSymmetricSphericalHarmonic< T >::m_SHCoefficients [private] |
coefficients of the spherical harmonic
Definition at line 275 of file WSymmetricSphericalHarmonic.h.
Referenced by WSymmetricSphericalHarmonic< T >::WSymmetricSphericalHarmonic().