Isis 3.0
Back | Home
OverlapNormalization.h
Go to the documentation of this file.
1 #ifndef OverlapNormalization_h
2 #define OverlapNormalization_h
3 
25 #include "Statistics.h"
26 #include "LeastSquares.h"
27 
28 namespace Isis {
29  class BasisFunction;
30 
76  public:
77 
78  OverlapNormalization(std::vector<Statistics *> statsList);
79 
80  virtual ~OverlapNormalization();
81 
89  enum AddStatus {
90 
95 
100 
105  };
106 
107  AddStatus AddOverlap(const Statistics &area1, const unsigned index1,
108  const Statistics &area2, const unsigned index2,
109  double weight = 1.0);
110 
117  inline void AddHold(unsigned holdIndex) {
118  m_idHoldList.push_back(holdIndex);
119  };
120 
126 
131 
136 
141 
150  };
151 
152  void Solve(SolutionType type = Both,
154 
155  double Average(const unsigned index) const;
156  double Gain(const unsigned index) const;
157  double Offset(const unsigned index) const;
158 
159  double Evaluate(double dn, unsigned index) const;
160 
161  private:
162 
166  std::vector<Statistics *> m_statsList;
167 
172  std::vector<int> m_idHoldList;
173 
183  class Overlap {
184  public:
185 
189  Statistics area1;
190 
194  Statistics area2;
195 
200  int index1;
201 
206  int index2;
207  };
208 
212  std::vector<Overlap> m_overlapList;
213 
218  std::vector<double> m_deltas;
219 
223  std::vector<double> m_weights;
224 
225 
229  bool m_solved;
230 
235  SolutionType m_solutionType;
236 
240  std::vector<double> m_gains;
241 
245  std::vector<double> m_offsets;
246 
247 
251  BasisFunction *m_gainFunction;
252 
256  BasisFunction *m_offsetFunction;
257 
261  LeastSquares *m_gainLsq;
262 
266  LeastSquares *m_offsetLsq;
267 
269  OverlapNormalization &operator=(const OverlapNormalization &);
270 
273  };
274 };
275 
276 #endif
OverlapNormalization(std::vector< Statistics * > statsList)
Constructs an OverlapNormalization object.
Definition: OverlapNormalization.cpp:45
AddStatus AddOverlap(const Statistics &area1, const unsigned index1, const Statistics &area2, const unsigned index2, double weight=1.0)
Attempts to add the given overlap data to a collection of valid overlaps, and returns the success or ...
Definition: OverlapNormalization.cpp:106
void Solve(SolutionType type=Both, LeastSquares::SolveMethod method=LeastSquares::QRD)
Attempts to solve the least squares equation for all data sets.
Definition: OverlapNormalization.cpp:163
QR Decomposition.
Definition: LeastSquares.h:131
double Offset(const unsigned index) const
Returns the calculated offset (base) for the given data set.
Definition: OverlapNormalization.cpp:351
Calculate only the offsets.
Definition: OverlapNormalization.h:135
SolutionType
Enumeration for whether user/programmer wants to calculate new gains, offsets, or both when solving...
Definition: OverlapNormalization.h:125
One or both areas contain no valid average.
Definition: OverlapNormalization.h:104
void AddHold(unsigned holdIndex)
Sets the list of files to be held during the solving process.
Definition: OverlapNormalization.h:117
double Evaluate(double dn, unsigned index) const
Returns a new DN from an old using the calculated gains and offsets of the data set the pixel belongs...
Definition: OverlapNormalization.cpp:374
SolveMethod
Definition: LeastSquares.h:130
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:109
Calculate the bases and multipliers for normalizing overlapping &quot;data sets&quot; (e.g., cubes).
Definition: OverlapNormalization.h:75
virtual ~OverlapNormalization()
Destroys the OverlapNormalization object, frees up pointers.
Definition: OverlapNormalization.cpp:72
Overlap is valid and was added successfully.
Definition: OverlapNormalization.h:94
double Gain(const unsigned index) const
Returns the calculated gain (multiplier) for the given data set.
Definition: OverlapNormalization.cpp:330
AddStatus
The result of the attempt to add overlap data to the list of valid overlaps, where Success is a succe...
Definition: OverlapNormalization.h:89
The equation being solved for Gains, Offsets, and Both is output = (input - average) * gain + offset ...
Definition: OverlapNormalization.h:149
Calculate both gains and offsets.
Definition: OverlapNormalization.h:140
double Average(const unsigned index) const
Returns the calculated average DN value for the given data set.
Definition: OverlapNormalization.cpp:309
Data sets do not overlap one another.
Definition: OverlapNormalization.h:99
Calculate only the gains.
Definition: OverlapNormalization.h:130

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:24:57