Isis Developer Reference
OverlapNormalization.h
Go to the documentation of this file.
1 #ifndef OverlapNormalization_h
2 #define OverlapNormalization_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "Statistics.h"
10 #include "LeastSquares.h"
11 
12 namespace Isis {
13  class BasisFunction;
14 
62  public:
63 
64  OverlapNormalization(std::vector<Statistics *> statsList);
65 
66  virtual ~OverlapNormalization();
67 
75  enum AddStatus {
76 
81 
86 
91  };
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 
112 
117 
122 
127 
136  };
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 
175  Statistics area1;
176 
180  Statistics area2;
181 
186  int index1;
187 
192  int index2;
193  };
194 
198  std::vector<Overlap> m_overlapList;
199 
204  std::vector<double> m_deltas;
205 
209  std::vector<double> m_weights;
210 
211 
215  bool m_solved;
216 
221  SolutionType m_solutionType;
222 
226  std::vector<double> m_gains;
227 
231  std::vector<double> m_offsets;
232 
233 
237  BasisFunction *m_gainFunction;
238 
242  BasisFunction *m_offsetFunction;
243 
247  LeastSquares *m_gainLsq;
248 
252  LeastSquares *m_offsetLsq;
253 
255  OverlapNormalization &operator=(const OverlapNormalization &);
256 
259  };
260 };
261 
262 #endif
Isis::OverlapNormalization::Gains
@ Gains
Calculate only the gains.
Definition: OverlapNormalization.h:116
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::OverlapNormalization::SolutionType
SolutionType
Enumeration for whether user/programmer wants to calculate new gains, offsets, or both when solving.
Definition: OverlapNormalization.h:111
Isis::Average
Functor for reduce using average functionality.
Definition: Reduce.h:107
Isis::BasisFunction
Generic linear equation class.
Definition: BasisFunction.h:48
Isis::OverlapNormalization::NoContrast
@ NoContrast
One or both areas contain no valid average.
Definition: OverlapNormalization.h:90
Isis::OverlapNormalization::Offset
double Offset(const unsigned index) const
Returns the calculated offset (base) for the given data set.
Definition: OverlapNormalization.cpp:335
Isis::OverlapNormalization::OverlapNormalization
OverlapNormalization(std::vector< Statistics * > statsList)
Constructs an OverlapNormalization object.
Definition: OverlapNormalization.cpp:29
Isis::Statistics::ValidPixels
BigInt ValidPixels() const
Returns the total number of valid pixels processed.
Definition: Statistics.cpp:433
Isis::OverlapNormalization::Offsets
@ Offsets
Calculate only the offsets.
Definition: OverlapNormalization.h:121
Isis::LeastSquares::SolveMethod
SolveMethod
Definition: LeastSquares.h:112
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
Isis::LeastSquares
Generic least square fitting class.
Definition: LeastSquares.h:99
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::OverlapNormalization::GainsWithoutNormalization
@ GainsWithoutNormalization
The equation being solved for Gains, Offsets, and Both is output = (input - average) * gain + offset ...
Definition: OverlapNormalization.h:135
Isis::OverlapNormalization::AddOverlap
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:90
Isis::OverlapNormalization::AddStatus
AddStatus
The result of the attempt to add overlap data to the list of valid overlaps, where Success is a succe...
Definition: OverlapNormalization.h:75
Isis::OverlapNormalization
Calculate the bases and multipliers for normalizing overlapping "data sets" (e.g.,...
Definition: OverlapNormalization.h:61
Isis::OverlapNormalization::AddHold
void AddHold(unsigned holdIndex)
Sets the list of files to be held during the solving process.
Definition: OverlapNormalization.h:103
LeastSquares.h
Isis::OverlapNormalization::Gain
double Gain(const unsigned index) const
Returns the calculated gain (multiplier) for the given data set.
Definition: OverlapNormalization.cpp:314
Isis::OverlapNormalization::Success
@ Success
Overlap is valid and was added successfully.
Definition: OverlapNormalization.h:80
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::OverlapNormalization::~OverlapNormalization
virtual ~OverlapNormalization()
Destroys the OverlapNormalization object, frees up pointers.
Definition: OverlapNormalization.cpp:56
BasisFunction.h
Isis::Statistics::Average
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:300
Isis::LeastSquares::QRD
@ QRD
QR Decomposition.
Definition: LeastSquares.h:113
Statistics.h
IException.h
Isis::OverlapNormalization::Both
@ Both
Calculate both gains and offsets.
Definition: OverlapNormalization.h:126
std
Namespace for the standard library.
OverlapNormalization.h
Isis::OverlapNormalization::Solve
void Solve(SolutionType type=Both, LeastSquares::SolveMethod method=LeastSquares::QRD)
Attempts to solve the least squares equation for all data sets.
Definition: OverlapNormalization.cpp:147
Isis::OverlapNormalization::Average
double Average(const unsigned index) const
Returns the calculated average DN value for the given data set.
Definition: OverlapNormalization.cpp:293
Isis::OverlapNormalization::Evaluate
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:358
Isis::OverlapNormalization::NoOverlap
@ NoOverlap
Data sets do not overlap one another.
Definition: OverlapNormalization.h:85
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16