source: trunk/src/ATrous/atrous.hh @ 221

Last change on this file since 221 was 220, checked in by Matthew Whiting, 17 years ago
  • Two new files: plots.cc and feedback.cc. Introduced to separate the declarations and definitions for various classes.
  • Mostly just improving the documentation for use with Doxygen.
File size: 4.1 KB
Line 
1#ifndef ATROUS_H
2#define ATROUS_H
3
4#ifndef PARAM_H
5#include <param.hh>
6#endif
7
8#include <vector>
9using std::vector;
10#include <string>
11using std::string;
12
13class Filter
14{
15public:
16  // these are all in atrous.cc
17  Filter();                         ///< Constructor
18  ~Filter();                        ///< Destructor
19  void   define(int code);          ///< Define the parameters for a given filter.
20  int    getNumScales(long length); ///< Calculate the number of scales possible with a given filter and data size.
21  int    getMaxSize(int scale);     ///< Calculate the maximum number of pixels able to be analysed with a filter at a given scale.
22
23  // these are inline functions.
24  string getName();                                      ///< Return filter name.
25  double coeff(int i);                                   ///< Return ith filter coefficient
26  void   setCoeff(int i, double val);                    ///< Set the ith filter coefficient
27  int    width();                                        ///< Return the filter width
28  int    maxFactor(int dim);                             ///< Return maximum number of scales possible.
29  void   setMaxFactor(int dim, int val);                 ///< Set the maximum number of scales.
30  double sigmaFactor(int dim, int scale);                ///< Return the sigma correction factor.
31  void   setSigmaFactor(int dim, int scale, double val); ///< Set the sigma correction factor.
32
33private:
34  string name;                ///< what is the filter called?
35  vector <double> filter1D;   ///< filter coefficients.
36  vector <int> maxNumScales;  ///< max number of scales for the sigmaFactor arrays, for each dim.
37  vector < vector <double>* > sigmaFactors; ///< arrays of sigmaFactors, one for each dim.
38
39  // these are all in atrous.cc
40  void   loadSpline();        ///< set up parameters for using the B3 Spline filter.
41  void   loadTriangle();      ///< set up parameters for using the Triangle function.
42  void   loadHaar();          ///< set up parameters for using the Haar wavelet.
43
44};
45
46// INLINE definitions for Filter member functions
47inline string Filter::getName(){return name;};
48inline double Filter::coeff(int i){return filter1D[i];};
49inline void   Filter::setCoeff(int i, double val){filter1D[i] = val;};
50inline int    Filter::width(){return filter1D.size();};
51inline int    Filter::maxFactor(int dim){return maxNumScales[dim-1];};
52inline void   Filter::setMaxFactor(int dim, int val){maxNumScales[dim-1] = val;};
53inline double Filter::sigmaFactor(int dim, int scale){return (*sigmaFactors[dim-1])[scale];};
54inline void   Filter::setSigmaFactor(int dim, int scale, double val){(*sigmaFactors[dim])[scale] = val;};
55
56
57
58// The tolerance in the reconstruction.
59const float reconTolerance = 0.005;
60
61//////////////////////////////////////////////////////////////////////////////////////
62
63void atrous1DReconstruct(long &size, float *&input, float *&output, Param &par);
64void atrous2DReconstruct(long &xdim, long &ydim, float *&input,float *&output, Param &par);
65void atrous3DReconstruct(long &xdim, long &ydim, long &zdim, float *&input,float *&output, Param &par);
66void atrous2DReconstructOLD(long &xdim, long &ydim, float *input,float *output, Param &par);
67void atrous3DReconstructOLD(long &xdim, long &ydim, long &zdim, float *&input,float *&output, Param &par);
68
69void atrousTransform(long &length, int &numScales, float *spectrum, double *coeffs, double *wavelet);
70void atrousTransform(long &length, float *spectrum, float *coeffs, float *wavelet);
71void atrousTransform2D(long &xdim, long &ydim, int &numScales, float *input, double *coeffs, double *wavelet, Param &par);
72void atrousTransform2D(long &xdim, long &ydim, int &numScales, float *input, double *coeffs, double *wavelet);
73void atrousTransform3D(long &xdim, long &ydim, long &zdim, int &numScales, float *&input, float *&coeffs, float *&wavelet, Param &par);
74void atrousTransform3D(long &xdim, long &ydim, long &zdim, int &numScales, float *input, float *coeffs, float *wavelet);
75
76void baselineSubtract(long numSpec, long specLength, float *originalCube, float *baseline, Param &par);
77void getBaseline(long size, float *input, float *baseline, Param &par);
78void getBaseline(long size, float *input, float *baseline);
79
80#endif
Note: See TracBrowser for help on using the repository browser.