Isis 3 Programmer Reference
OverlapNormalization.h
1#ifndef OverlapNormalization_h
2#define OverlapNormalization_h
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "Statistics.h"
10#include "LeastSquares.h"
11
12namespace Isis {
13 class BasisFunction;
14
62 public:
63
64 OverlapNormalization(std::vector<Statistics *> statsList);
65
66 virtual ~OverlapNormalization();
67
92
93 AddStatus AddOverlap(const Statistics &area1, const unsigned index1,
94 const Statistics &area2, const unsigned index2,
95 double weight = 1.0);
96
103 inline void AddHold(unsigned holdIndex) {
104 m_idHoldList.push_back(holdIndex);
105 };
106
137
138 void Solve(SolutionType type = Both,
140
141 double Average(const unsigned index) const;
142 double Gain(const unsigned index) const;
143 double Offset(const unsigned index) const;
144
145 double Evaluate(double dn, unsigned index) const;
146
147 private:
148
152 std::vector<Statistics *> m_statsList;
153
158 std::vector<int> m_idHoldList;
159
169 class Overlap {
170 public:
171
176
181
187
193 };
194
198 std::vector<Overlap> m_overlapList;
199
204 std::vector<double> m_deltas;
205
209 std::vector<double> m_weights;
210
211
216
222
226 std::vector<double> m_gains;
227
231 std::vector<double> m_offsets;
232
233
238
243
248
253
256
259 };
260};
261
262#endif
Generic linear equation class.
Generic least square fitting class.
@ QRD
QR Decomposition.
Store statistics pertaining to the overlapping areas and indices (corresponding to the statistics lis...
int index1
Index corresponding to m_statsList for the first overlapping data set.
Statistics area2
Overlapping area for the second data set.
int index2
Index corresponding to m_statsList for the second overlapping data set.
Statistics area1
Overlapping area for the first data set.
Calculate the bases and multipliers for normalizing overlapping "data sets" (e.g.,...
std::vector< double > m_gains
Vector of calculated gains filled by the Solve method.
OverlapNormalization(const OverlapNormalization &)
Cannot copy this object.
std::vector< int > m_idHoldList
Vector of indices corresponding to the m_statsList vector representing data sets to be held in soluti...
OverlapNormalization(std::vector< Statistics * > statsList)
Constructs an OverlapNormalization object.
std::vector< double > m_weights
Vector of weights for every valid overlap.
bool m_solved
Whether or not the least squares solution has been solved.
BasisFunction * m_offsetFunction
The offset function to be solved.
double Offset(const unsigned index) const
Returns the calculated offset (base) for the given data set.
SolutionType m_solutionType
Whether the user of this class wants to solve for the offsets, the gains, or both.
std::vector< double > m_deltas
Vector of delta values (differences between the averages of two overlapping data sets) for every vali...
LeastSquares * m_offsetLsq
The least squares object that calculates offsets.
BasisFunction * m_gainFunction
The gain function to be solved.
std::vector< Overlap > m_overlapList
Vector of valid overlaps collected.
double Average(const unsigned index) const
Returns the calculated average DN value for the given data set.
void AddHold(unsigned holdIndex)
Sets the list of files to be held during the solving process.
std::vector< double > m_offsets
Vector of calculated offsets filled by the Solve method.
virtual ~OverlapNormalization()
Destroys the OverlapNormalization object, frees up pointers.
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 ...
SolutionType
Enumeration for whether user/programmer wants to calculate new gains, offsets, or both when solving.
@ Offsets
Calculate only the offsets.
@ Both
Calculate both gains and offsets.
@ Gains
Calculate only the gains.
@ GainsWithoutNormalization
The equation being solved for Gains, Offsets, and Both is output = (input - average) * gain + offset ...
AddStatus
The result of the attempt to add overlap data to the list of valid overlaps, where Success is a succe...
@ NoOverlap
Data sets do not overlap one another.
@ Success
Overlap is valid and was added successfully.
@ NoContrast
One or both areas contain no valid average.
std::vector< Statistics * > m_statsList
Vector of Statistics objects for each data set.
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...
LeastSquares * m_gainLsq
The least squares object that solves for the new gains.
double Gain(const unsigned index) const
Returns the calculated gain (multiplier) for the given data set.
OverlapNormalization & operator=(const OverlapNormalization &)
Cannot copy this object.
void Solve(SolutionType type=Both, LeastSquares::SolveMethod method=LeastSquares::QRD)
Attempts to solve the least squares equation for all data sets.
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16