source: branches/pixel-map-branch/src/ATrous/filter.hh @ 1441

Last change on this file since 1441 was 232, checked in by Matthew Whiting, 17 years ago

Large raft of changes. Most are minor ones related to fixing up the use of std::string and std::vector (whether they are declared as using, or not...). Other changes include:

  • Moving the reconstruction filter class Filter into its own header/implementation files filter.{hh,cc}. As a result, the atrous.cc file is removed, but atrous.hh remains with just the function prototypes.
  • Incorporating a Filter object into the Param set, so that the reconstruction routines can see it without the messy "extern" call. The define() function is now called in both the Param() and Param::readParams() functions, and no longer in the main body.
  • Col functions in columns.cc moved into the Column namespace, while the template function printEntry is moved into the columns.hh file -- it would not compile on delphinus with it in the columns.cc, even though all the implementations were present.
  • Improved the introductory section of the Guide, with a bit more detail about each of the execution steps. This way the reader can read this section and have a reasonably good idea about what is happening.
  • Other minor changes to the Guide.
File size: 2.1 KB
Line 
1#ifndef FILTER_H
2#define FILTER_H
3
4#include <vector>
5#include <string>
6
7/**
8 * A class to store details of the wavelet's filter.
9 * This stores all details of and functions related to the filter used to
10 *  generate the wavelets used in the reconstruction (and baseline
11 *  subtraction) functions.
12 *
13 * It stores the coefficients of the filter, as well as the number of scales
14 * associated with it, and the sigma factors, that relate the value of the rms
15 * at a given scale with the measured value.
16 */
17
18class Filter
19{
20public:
21  // these are all in atrous.cc
22  Filter();                         ///< Constructor
23  virtual ~Filter();                ///< Destructor
24
25  /** Define the parameters for a given filter. */
26  void   define(int code);
27
28  /** Calculate the number of scales possible with a given filter and data size. */
29  int    getNumScales(long length);
30
31  /** Calculate the maximum number of pixels able to be analysed with a filter at a given scale. */
32  int    getMaxSize(int scale);
33
34  /** Return the width of the filter */
35  int    width(){return filter1D.size();};
36
37  // these are inline functions.
38  std::string getName(){return name;};
39  double coeff(int i){return filter1D[i];};
40  void   setCoeff(int i, double val){filter1D[i] = val;};
41  int    maxFactor(int dim){return maxNumScales[dim-1];};
42  void   setMaxFactor(int dim, int val){maxNumScales[dim-1] = val;};
43  double sigmaFactor(int dim, int scale){return (*sigmaFactors[dim-1])[scale];};
44  void   setSigmaFactor(int dim, int scale, double val){(*sigmaFactors[dim])[scale] = val;};
45
46private:
47  std::string name;                ///< what is the filter called?
48  std::vector <double> filter1D;   ///< filter coefficients.
49  std::vector <int> maxNumScales;  ///< max number of scales for the sigmaFactor arrays, for each dim.
50  std::vector < std::vector <double>* > sigmaFactors; ///< arrays of sigmaFactors, one for each dim.
51
52  // these are all in atrous.cc
53  void   loadSpline();        ///< set up parameters for using the B3 Spline filter.
54  void   loadTriangle();      ///< set up parameters for using the Triangle function.
55  void   loadHaar();          ///< set up parameters for using the Haar wavelet.
56
57};
58
59#endif
60
Note: See TracBrowser for help on using the repository browser.