Xmipp
v3.23.11-Nereus
xmipp
libraries
data
spherical_harmonics.h
Go to the documentation of this file.
1
/***************************************************************************
2
* Authors: AUTHOR_NAME (jvargas@cnb.csic.es)
3
*
4
*
5
* Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
* 02111-1307 USA
21
*
22
* All comments concerning this program package may be sent to the
23
* e-mail address 'xmipp@cnb.csic.es'
24
***************************************************************************/
25
26
#ifndef SPHERICAL_HARMONICS_H_
27
#define SPHERICAL_HARMONICS_H_
28
29
#include <
core/alglib/specialfunctions.h
>
30
31
#include <
core/multidim_array.h
>
32
#include <
core/matrix2d.h
>
33
//#include "../../../kk/gsl-1.16/gsl/gsl_sf_gegenbauer.h"
34
35
# define pi 3.14159265358979323846
/* pi */
36
# define sampling 100;
37
38
#endif
/* SPHERICAL_HARMONICS_H_ */
39
43
//Spherical harmonics (SH) as defined by Guan Koay in "A signal transformational
44
//framework for breaking the noise floor and its applications in MRI".
45
//he obtained Spherical harmonics are real and orthonormal. Theta is zenith angle and varphi is azimuthal angle, as defined in
46
// physics space
47
class
PolySphericalHarmonics
48
{
49
private
:
50
51
bool
save;
52
53
public
:
54
55
void
shPols
(
int
degree,
MultidimArray<double>
& im,
int
verbose=0);
56
57
inline
double
shPols
(
int
degree,
int
m
,
double
theta
,
double
varphi);
58
59
private
:
60
61
62
//We store it as double because there is a lot of division between factorials in the
63
// SH implementation
64
inline
double
factorial(
size_t
n
)
65
{
66
double
f
=1;
67
68
for
(
size_t
var = 1; var <=
n
; var++)
69
f *= var;
70
71
return
f
;
72
}
73
74
public
:
75
76
PolySphericalHarmonics
(
bool
doSave=
false
)
77
{
78
save = doSave;
79
}
80
81
};
83
84
85
PolySphericalHarmonics::shPols
void shPols(int degree, MultidimArray< double > &im, int verbose=0)
Definition:
spherical_harmonics.cpp:29
MultidimArray< double >
PolySphericalHarmonics::PolySphericalHarmonics
PolySphericalHarmonics(bool doSave=false)
Definition:
spherical_harmonics.h:76
theta
double theta
Definition:
numerical_recipes.cpp:6214
f
double * f
Definition:
numerical_recipes.cpp:4414
matrix2d.h
m
int m
Definition:
image_find_center.cpp:57
specialfunctions.h
PolySphericalHarmonics
Definition:
spherical_harmonics.h:47
n
int * n
Definition:
numerical_recipes.cpp:2229
multidim_array.h
Generated by
1.8.13