iRoCS Toolbox  1.1.0
SH_tools.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Margret Keuper, Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
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 3 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 Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 #ifndef SHTOOLS_HH
24 #define SHTOOLS_HH
25 
26 #ifdef HAVE_CONFIG_H
27 #include <config.hh>
28 #endif
29 
30 #include <vector>
31 #include <blitz/array.h>
32 #include <gsl/gsl_sf_legendre.h>
33 
34 namespace segmentation
35 {
36 
37  typedef blitz::Array<std::complex<double>,2> SpatialArray;
38  typedef blitz::Array<std::complex<double>,1> FrequencyArray;
39  typedef std::vector<SpatialArray*> SpatialVecArray;
40  typedef std::vector<FrequencyArray*> FrequencyVecArray;
41 
42  ptrdiff_t thetaToIndex(double theta, int bw);
43 
44  ptrdiff_t phiToIndex(double phi, int bw);
45 
46  double indexToTheta(ptrdiff_t index, int bw);
47 
48  double indexToPhi(ptrdiff_t index, int bw);
49 
50  blitz::TinyVector<double,2> indexToAngles(
51  blitz::TinyVector<ptrdiff_t,2> const &index, int bw);
52 
53 // Compute the linear index in a complex-valued array for the given bandwidth,
54 // band and order (To get the position in the corresponding interleaved float
55 // Array, multiply by two)
56  ptrdiff_t linearIndex(int bw, int l, int m);
57 
58  void SH_dtheta_up(double const *c, int bw, double * d_theta);
59 
60  void SH_dtheta(FrequencyArray const &c, SpatialArray &d_theta,
61  int degree);
62 
63  void SH_dtheta(double const *c, int bw, double *d_theta, int degree = 1);
64 
65  void SH_dpsi(double const *c, int bw, double *d_psi);
66 
67  void SH_normal(double const *cx, double const *cy ,double const *cz,
68  double *nx, double *ny, double *nz, int bw);
69 
70  void SH_normal(double const *cx, double *nx, double *ny, double *nz, int bw);
71 
72  void SH_curvature(double const *cx, double *curvature, int bw);
73 
74  float SH_volume(double const *cx, int bw);
75 
76  void SH_curvature(double const *cx, double const *cy ,double const *cz,
77  double *curvature, int bw);
78 
79  void SH_curvature_gaussian(double const *cx, double const *cy ,
80  double const *cz, double *curvature, int bw);
81 
82  void SH_curvature_hesse(double const *cx, double const *cy ,double const *cz,
83  double *curvature, int bw);
84 
85 }
86 
87 #endif
ptrdiff_t phiToIndex(double phi, int bw)
double indexToTheta(ptrdiff_t index, int bw)
float SH_volume(double const *cx, int bw)
blitz::Array< std::complex< double >, 2 > SpatialArray
Definition: SH_tools.hh:37
std::vector< SpatialArray * > SpatialVecArray
Definition: SH_tools.hh:39
blitz::Array< std::complex< double >, 1 > FrequencyArray
Definition: SH_tools.hh:38
void SH_dtheta(FrequencyArray const &c, SpatialArray &d_theta, int degree)
blitz::TinyVector< double, 2 > indexToAngles(blitz::TinyVector< ptrdiff_t, 2 > const &index, int bw)
void SH_normal(double const *cx, double const *cy, double const *cz, double *nx, double *ny, double *nz, int bw)
void SH_curvature_gaussian(double const *cx, double const *cy, double const *cz, double *curvature, int bw)
ptrdiff_t thetaToIndex(double theta, int bw)
std::vector< FrequencyArray * > FrequencyVecArray
Definition: SH_tools.hh:40
void SH_curvature(double const *cx, double *curvature, int bw)
void SH_dtheta_up(double const *c, int bw, double *d_theta)
ptrdiff_t linearIndex(int bw, int l, int m)
double indexToPhi(ptrdiff_t index, int bw)
void SH_dpsi(double const *c, int bw, double *d_psi)
void SH_curvature_hesse(double const *cx, double const *cy, double const *cz, double *curvature, int bw)