Isis 3 Programmer Reference
ControlNetStatistics.h
1 #ifndef _CONTROLNETSTATISTICS_H_
2 #define _CONTROLNETSTATISTICS_H_
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QMap>
13 #include <QVector>
14 
15 #include "Progress.h"
16 #include "PvlGroup.h"
17 #include "SerialNumberList.h"
18 #include "Statistics.h"
19 
20 namespace Isis {
21  class ControlNet;
22  class Progress;
23  class PvlGroup;
24 
64  public:
66  ControlNetStatistics(ControlNet *pCNet, const QString &psSerialNumFile, Progress *pProgress = 0);
67 
69  ControlNetStatistics(ControlNet *pCNet, Progress *pProgress = 0);
70 
73 
75  enum ePointDetails { total, ignore, locked, fixed, constrained, freed };
76  static const int numPointDetails = 6;
77 
79  enum ePointIntStats { totalPoints, validPoints, ignoredPoints, fixedPoints, constrainedPoints, freePoints, editLockedPoints,
80  totalMeasures, validMeasures, ignoredMeasures, editLockedMeasures };
81  static const int numPointIntStats = 11;
82 
84  enum ePointDoubleStats { avgResidual, minResidual, maxResidual, minLineResidual, maxLineResidual, minSampleResidual, maxSampleResidual,
85  avgPixelShift, minPixelShift, maxPixelShift, minLineShift, maxLineShift, minSampleShift, maxSampleShift,
86  minGFit, maxGFit, minEccentricity, maxEccentricity, minPixelZScore, maxPixelZScore};
87  static const int numPointDblStats = 20;
88 
90  enum ImageStats { imgSamples, imgLines, imgTotalPoints, imgIgnoredPoints, imgFixedPoints, imgLockedPoints, imgLocked,
91  imgConstrainedPoints, imgFreePoints, imgConvexHullArea, imgConvexHullRatio };
92  static const int numImageStats = 11;
93 
95  void GenerateImageStats();
96 
98  void PrintImageStats(const QString &psImageFile);
99 
101  QVector<double> GetImageStatsBySerialNum(QString psSerialNum) const;
102 
104  void GeneratePointStats(const QString &psPointFile);
105 
107  void GenerateControlNetStats(PvlGroup &pStatsGrp);
108 
110  int NumValidPoints() const {
111  return (*mPointIntStats.find(validPoints));
112  }
113 
115  int NumFixedPoints() const {
116  return (*mPointIntStats.find(fixedPoints));
117  }
118 
120  int NumConstrainedPoints() const {
121  return (*mPointIntStats.find(constrainedPoints));
122  }
123 
125  int NumFreePoints() const {
126  return (*mPointIntStats.find(freePoints));
127  }
128 
130  int NumIgnoredPoints() const {
131  return (*mPointIntStats.find(ignoredPoints));
132  }
133 
135  int NumEditLockedPoints() const {
136  return (*mPointIntStats.find(editLockedPoints));
137  }
138 
140  int NumMeasures() const {
141  return (*mPointIntStats.find(totalMeasures));
142  }
143 
145  int NumValidMeasures() const {
146  return (*mPointIntStats.find(validMeasures));
147  }
148 
150  int NumIgnoredMeasures() const {
151  return (*mPointIntStats.find(ignoredMeasures));
152  }
153 
155  int NumEditLockedMeasures() const {
156  return (*mPointIntStats.find(editLockedMeasures));
157  }
158 
160  double GetAverageResidual() const {
161  return (*mPointDoubleStats.find(avgResidual));
162  }
163 
165  double GetMinimumResidual() const {
166  return (*mPointDoubleStats.find(minResidual));
167  }
168 
170  double GetMaximumResidual() const {
171  return (*mPointDoubleStats.find(maxResidual));
172  }
173 
175  double GetMinLineResidual() const {
176  return (*mPointDoubleStats.find(minLineResidual));
177  }
178 
180  double GetMinSampleResidual() const {
181  return (*mPointDoubleStats.find(minSampleResidual));
182  }
183 
185  double GetMaxLineResidual() const {
186  return (*mPointDoubleStats.find(maxLineResidual));
187  }
188 
190  double GetMaxSampleResidual() const {
191  return (*mPointDoubleStats.find(maxSampleResidual));
192  }
193 
195  double GetMinLineShift() const {
196  return (*mPointDoubleStats.find(minLineShift));
197  }
198 
200  double GetMaxLineShift() const {
201  return (*mPointDoubleStats.find(maxLineShift));
202  }
203 
205  double GetMinSampleShift() const {
206  return (*mPointDoubleStats.find(minSampleShift));
207  }
208 
210  double GetMaxSampleShift() const {
211  return (*mPointDoubleStats.find(maxSampleShift));
212  }
213 
215  double GetMinPixelShift() const {
216  return (*mPointDoubleStats.find(minPixelShift));
217  }
218 
220  double GetMaxPixelShift() const {
221  return (*mPointDoubleStats.find(maxPixelShift));
222  }
223 
225  double GetAvgPixelShift() const {
226  return (*mPointDoubleStats.find(avgPixelShift));
227  }
228 
229  protected:
233 
234  private:
239 
241  void GetPointIntStats();
242 
244  void GetPointDoubleStats();
245 
246  void UpdateMinMaxStats(const Statistics & stats,
247  ePointDoubleStats min,
248  ePointDoubleStats max);
249 
251  void InitPointDoubleStats();
252 
254  void InitSerialNumMap();
255 
256  int numCNetImages;
257 
258  Statistics mConvexHullStats, mConvexHullRatioStats;
259  };
260 }
261 #endif
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::ControlNetStatistics::GenerateImageStats
void GenerateImageStats()
Generate stats like Total, Ignored, Fixed Points in an Image.
Definition: ControlNetStatistics.cpp:220
Isis::ControlNetStatistics::GetMaxPixelShift
double GetMaxPixelShift() const
Get network Max PixelShift.
Definition: ControlNetStatistics.h:220
Isis::ControlNetStatistics::GetMaxLineShift
double GetMaxLineShift() const
Get network Max LineShift.
Definition: ControlNetStatistics.h:200
Isis::ControlNetStatistics::ePointDoubleStats
ePointDoubleStats
Enumeration for Point stats like Tolerances, PixelShifts which have double data.
Definition: ControlNetStatistics.h:84
Isis::ControlNetStatistics::GetPointIntStats
void GetPointIntStats()
Get point count stats.
Definition: ControlNetStatistics.cpp:446
Isis::ControlNetStatistics::GetMinLineResidual
double GetMinLineResidual() const
Determine the minimum line error of all points in the network.
Definition: ControlNetStatistics.h:175
Isis::ControlNetStatistics::ImageStats
ImageStats
Enumeration for image stats.
Definition: ControlNetStatistics.h:90
Isis::ControlNetStatistics::NumValidPoints
int NumValidPoints() const
Returns the Number of Valid (Not Ignored) Points in the Control Net.
Definition: ControlNetStatistics.h:110
Isis::ControlNetStatistics::GetAvgPixelShift
double GetAvgPixelShift() const
Get network Avg PixelShift.
Definition: ControlNetStatistics.h:225
Isis::ControlNetStatistics::GetMaxSampleResidual
double GetMaxSampleResidual() const
Determine the maximum sample error of all points in the network.
Definition: ControlNetStatistics.h:190
Isis::ControlNetStatistics::mPointDoubleStats
QMap< int, double > mPointDoubleStats
Contains QMap of different computed stats.
Definition: ControlNetStatistics.h:236
Isis::ControlNetStatistics::mConvexHullRatioStats
Statistics mConvexHullRatioStats
min, max, average convex hull stats
Definition: ControlNetStatistics.h:258
Isis::ControlNetStatistics::mPointIntStats
QMap< int, int > mPointIntStats
Contains QMap of different count stats.
Definition: ControlNetStatistics.h:235
Isis::ControlNetStatistics::NumIgnoredMeasures
int NumIgnoredMeasures() const
Returns the total Number of Ignored Measures in the Control Net.
Definition: ControlNetStatistics.h:150
Isis::ControlNetStatistics::GetMaximumResidual
double GetMaximumResidual() const
Determine the maximum error of all points in the network.
Definition: ControlNetStatistics.h:170
Isis::ControlNetStatistics::GetImageStatsBySerialNum
QVector< double > GetImageStatsBySerialNum(QString psSerialNum) const
Returns the Image Stats by Serial Number.
Definition: ControlNetStatistics.cpp:379
Isis::ControlNetStatistics::GetMinSampleResidual
double GetMinSampleResidual() const
Determine the minimum sample error of all points in the network.
Definition: ControlNetStatistics.h:180
Isis::ControlNetStatistics::ControlNetStatistics
ControlNetStatistics(ControlNet *pCNet, const QString &psSerialNumFile, Progress *pProgress=0)
Constructor.
Definition: ControlNetStatistics.cpp:52
Isis::SerialNumberList
Serial Number list generator.
Definition: SerialNumberList.h:64
Isis::ControlNetStatistics::GetPointDoubleStats
void GetPointDoubleStats()
Get Point stats for Residuals and Shifts.
Definition: ControlNetStatistics.cpp:518
Isis::ControlNetStatistics::~ControlNetStatistics
~ControlNetStatistics()
Destructor.
Definition: ControlNetStatistics.cpp:88
Isis::ControlNetStatistics::NumConstrainedPoints
int NumConstrainedPoints() const
Returns the number of Constrained Points in Control Net.
Definition: ControlNetStatistics.h:120
Isis::ControlNetStatistics::NumEditLockedPoints
int NumEditLockedPoints() const
Returns total number of edit locked points.
Definition: ControlNetStatistics.h:135
Isis::ControlNetStatistics::NumFixedPoints
int NumFixedPoints() const
Returns the Number of Fixed Points in the Control Net.
Definition: ControlNetStatistics.h:115
Isis::ControlNetStatistics::mImageMap
QMap< QString, QVector< double > > mImageMap
Contains stats by Image/Serial Num.
Definition: ControlNetStatistics.h:237
Isis::ControlNetStatistics::GetMaxLineResidual
double GetMaxLineResidual() const
Determine the maximum line error of all points in the network.
Definition: ControlNetStatistics.h:185
Isis::ControlNetStatistics::NumIgnoredPoints
int NumIgnoredPoints() const
Returns the number of ignored points.
Definition: ControlNetStatistics.h:130
Isis::ControlNetStatistics::GetMaxSampleShift
double GetMaxSampleShift() const
Get network Max SampleShift.
Definition: ControlNetStatistics.h:210
Isis::ControlNetStatistics::InitPointDoubleStats
void InitPointDoubleStats()
Init Pointstats std::vector.
Definition: ControlNetStatistics.cpp:505
Isis::ControlNetStatistics::GetMinPixelShift
double GetMinPixelShift() const
Get network Min PixelShift.
Definition: ControlNetStatistics.h:215
Isis::ControlNetStatistics::NumValidMeasures
int NumValidMeasures() const
Returns the total Number of valid Measures in the Control Net.
Definition: ControlNetStatistics.h:145
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::ControlNetStatistics::PrintImageStats
void PrintImageStats(const QString &psImageFile)
Print the Image Stats into specified output file.
Definition: ControlNetStatistics.cpp:323
Isis::ControlNetStatistics::GetAverageResidual
double GetAverageResidual() const
Determine the average error of all points in the network.
Definition: ControlNetStatistics.h:160
Isis::ControlNetStatistics::ePointIntStats
ePointIntStats
Enumeration for Point int stats for counts such as valid points, measures etc.
Definition: ControlNetStatistics.h:79
Isis::ControlNetStatistics::mSerialNumMap
QMap< QString, bool > mSerialNumMap
Whether serial# is part of ControlNet.
Definition: ControlNetStatistics.h:238
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::ControlNetStatistics::GetMinSampleShift
double GetMinSampleShift() const
Get network Min SampleShift.
Definition: ControlNetStatistics.h:205
Isis::ControlNetStatistics::GenerateControlNetStats
void GenerateControlNetStats(PvlGroup &pStatsGrp)
Generate the Control Net Stats into the PvlGroup.
Definition: ControlNetStatistics.cpp:116
Isis::ControlNetStatistics::NumEditLockedMeasures
int NumEditLockedMeasures() const
Returns total number of edit locked measures in the network.
Definition: ControlNetStatistics.h:155
Isis::ControlNetStatistics::InitSerialNumMap
void InitSerialNumMap()
Init SerialNum std::map.
Definition: ControlNetStatistics.cpp:97
Isis::ControlNetStatistics::GetMinimumResidual
double GetMinimumResidual() const
Determine the minimum error of all points in the network.
Definition: ControlNetStatistics.h:165
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::ControlNetStatistics
Control Network Stats.
Definition: ControlNetStatistics.h:63
Isis::ControlNetStatistics::GeneratePointStats
void GeneratePointStats(const QString &psPointFile)
Generate stats like Ignored, Fixed, Total Measures, Ignored by Control Point.
Definition: ControlNetStatistics.cpp:393
Isis::ControlNetStatistics::NumMeasures
int NumMeasures() const
Returns the total Number of Measures in the Control Net.
Definition: ControlNetStatistics.h:140
QMap< int, int >
Isis::ControlNetStatistics::ePointDetails
ePointDetails
Enumeration for Point Statistics.
Definition: ControlNetStatistics.h:75
QVector< double >
Isis::ControlNetStatistics::mSerialNumList
SerialNumberList mSerialNumList
Serial Number List.
Definition: ControlNetStatistics.h:230
Isis::ControlNetStatistics::GetMinLineShift
double GetMinLineShift() const
Get Min and Max LineShift.
Definition: ControlNetStatistics.h:195
Isis::ControlNetStatistics::NumFreePoints
int NumFreePoints() const
Returns the number of Constrained Points in Control Net.
Definition: ControlNetStatistics.h:125
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlNetStatistics::mProgress
Progress * mProgress
Progress state.
Definition: ControlNetStatistics.h:232
Isis::ControlNetStatistics::mCNet
ControlNet * mCNet
Control Network.
Definition: ControlNetStatistics.h:231