Developer documentation
Version 3.0.3-105-gd3941f44
SH.h File Reference
#include "math/legendre.h"
#include "math/least_squares.h"

Go to the source code of this file.

Classes

class  MR::Math::SH::Transform< ValueType >
 
class  MR::Math::SH::PrecomputedFraction< ValueType >
 used to speed up SH calculation More...
 
class  MR::Math::SH::PrecomputedAL< ValueType >
 Precomputed Associated Legrendre Polynomials - used to speed up SH calculation. More...
 
class  MR::Math::SH::aPSF< ValueType >
 a class to hold the coefficients for an apodised point-spread function. More...
 

Namespaces

namespace  MR
 
namespace  MR::Math
 
namespace  MR::Math::SH
 

Macros

#define MAX_DIR_CHANGE   0.2
 
#define ANGLE_TOLERANCE   1e-4
 

Functions

size_t MR::Math::SH::NforL (int lmax)
 the number of (even-degree) coefficients for the given value of lmax More...
 
size_t MR::Math::SH::index (int l, int m)
 compute the index for coefficient (l,m) More...
 
size_t MR::Math::SH::NforL_mpos (int lmax)
 same as NforL(), but consider only non-negative orders m More...
 
size_t MR::Math::SH::index_mpos (int l, int m)
 same as index(), but consider only non-negative orders m More...
 
size_t MR::Math::SH::LforN (int N)
 returns the largest lmax given N parameters More...
 
template<class MatrixType >
Eigen::Matrix< typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic > MR::Math::SH::init_transform (const MatrixType &dirs, const int lmax)
 form the SH->amplitudes matrix More...
 
template<class MatrixType >
Eigen::Matrix< typename MatrixType::Scalar, Eigen::Dynamic, Eigen::Dynamic > MR::Math::SH::init_transform_cart (const MatrixType &dirs, const int lmax)
 form the SH->amplitudes matrix More...
 
template<class MatrixType , class VectorType >
void MR::Math::SH::scale_degrees_forward (MatrixType &SH2amp_mapping, const VectorType &coefs)
 scale the coefficients of each SH degree by the corresponding value in coefs More...
 
template<typename MatrixType , class VectorType >
void MR::Math::SH::scale_degrees_inverse (MatrixType &amp2SH_mapping, const VectorType &coefs)
 scale the coefficients of each SH degree by the corresponding value in coefs More...
 
template<typename VectorType >
Eigen::Matrix< typename VectorType::Scalar, Eigen::Dynamic, 1 > MR::Math::SH::invert (const VectorType &coefs)
 invert any non-zero coefficients in coefs More...
 
template<class VectorType >
VectorType::Scalar MR::Math::SH::value (const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
 
template<class VectorType >
VectorType::Scalar MR::Math::SH::value (const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar azimuth, int lmax)
 
template<class VectorType1 , class VectorType2 >
VectorType1::Scalar MR::Math::SH::value (const VectorType1 &coefs, const VectorType2 &unit_dir, int lmax)
 
template<class VectorType1 , class VectorType2 >
VectorType1 & MR::Math::SH::delta (VectorType1 &delta_vec, const VectorType2 &unit_dir, int lmax)
 
template<class VectorType1 , class VectorType2 >
VectorType1 & MR::Math::SH::SH2RH (VectorType1 &RH, const VectorType2 &sh)
 
template<class VectorType >
Eigen::Matrix< typename VectorType::Scalar, Eigen::Dynamic, 1 > MR::Math::SH::SH2RH (const VectorType &sh)
 
template<class VectorType1 , class VectorType2 >
VectorType1 & MR::Math::SH::sconv (VectorType1 &sh, const VectorType2 &RH)
 perform spherical convolution, in place More...
 
template<class VectorType1 , class VectorType2 , class VectorType3 >
VectorType1 & MR::Math::SH::sconv (VectorType1 &C, const VectorType2 &RH, const VectorType3 &sh)
 perform spherical convolution More...
 
template<class MatrixType1 , class VectorType2 >
MatrixType1 & MR::Math::SH::sconv_mat (MatrixType1 &sh, const VectorType2 &RH)
 perform spherical convolution, in place More...
 
template<class VectorType , class UnitVectorType , class ValueType = float>
VectorType::Scalar MR::Math::SH::get_peak (const VectorType &sh, int lmax, UnitVectorType &unit_init_dir, PrecomputedAL< typename VectorType::Scalar > *precomputer=nullptr)
 estimate direction & amplitude of SH peak More...
 
template<class VectorType >
void MR::Math::SH::derivatives (const VectorType &sh, const int lmax, const typename VectorType::Scalar elevation, const typename VectorType::Scalar azimuth, typename VectorType::Scalar &amplitude, typename VectorType::Scalar &dSH_del, typename VectorType::Scalar &dSH_daz, typename VectorType::Scalar &d2SH_del2, typename VectorType::Scalar &d2SH_deldaz, typename VectorType::Scalar &d2SH_daz2, PrecomputedAL< typename VectorType::Scalar > *precomputer)
 computes first and second order derivatives of SH series More...
 
template<class ImageType >
void MR::Math::SH::check (const ImageType &H)
 convenience function to check if an input image can contain SH coefficients More...
 

Variables

const char * MR::Math::SH::encoding_description
 a string containing a description of the SH storage convention More...
 

Macro Definition Documentation

◆ ANGLE_TOLERANCE

#define ANGLE_TOLERANCE   1e-4

Definition at line 24 of file SH.h.

◆ MAX_DIR_CHANGE

#define MAX_DIR_CHANGE   0.2

Definition at line 23 of file SH.h.