Isis 3.0 Programmer Reference
Back | Home
ControlNetStatistics.h
Go to the documentation of this file.
1 #ifndef _CONTROLNETSTATISTICS_H_
2 #define _CONTROLNETSTATISTICS_H_
3 
4 #include <map>
5 #include <iostream>
6 #include <vector>
7 #include "Progress.h"
8 #include "PvlGroup.h"
9 #include "SerialNumberList.h"
10 #include "Statistics.h"
11 
35 namespace Isis {
36  class ControlNet;
37  class ControlCubeGraphNode;
38  class Progress;
39  class PvlGroup;
40 
80  public:
82  ControlNetStatistics(ControlNet *pCNet, const QString &psSerialNumFile, Progress *pProgress = 0);
83 
85  ControlNetStatistics(ControlNet *pCNet, Progress *pProgress = 0);
86 
89 
91  enum ePointDetails { total, ignore, locked, fixed, constrained, freed };
92  static const int numPointDetails = 6;
93 
95  enum ePointIntStats { totalPoints, validPoints, ignoredPoints, fixedPoints, constrainedPoints, freePoints, editLockedPoints,
96  totalMeasures, validMeasures, ignoredMeasures, editLockedMeasures };
97  static const int numPointIntStats = 11;
98 
100  enum ePointDoubleStats { avgResidual, minResidual, maxResidual, minLineResidual, maxLineResidual, minSampleResidual, maxSampleResidual,
101  avgPixelShift, minPixelShift, maxPixelShift, minLineShift, maxLineShift, minSampleShift, maxSampleShift,
102  minGFit, maxGFit, minEccentricity, maxEccentricity, minPixelZScore, maxPixelZScore};
103  static const int numPointDblStats = 20;
104 
106  enum ImageStats { imgSamples, imgLines, imgTotalPoints, imgIgnoredPoints, imgFixedPoints, imgLockedPoints, imgLocked,
107  imgConstrainedPoints, imgFreePoints, imgConvexHullArea, imgConvexHullRatio };
108  static const int numImageStats = 11;
109 
111  void GenerateImageStats();
112 
114  void PrintImageStats(const QString &psImageFile);
115 
117  std::vector<double> GetImageStatsBySerialNum(QString psSerialNum) const;
118 
120  void GeneratePointStats(const QString &psPointFile);
121 
123  void GenerateControlNetStats(PvlGroup &pStatsGrp);
124 
126  int NumValidPoints() const {
127  return (*mPointIntStats.find(validPoints)).second;
128  }
129 
131  int NumFixedPoints() const {
132  return (*mPointIntStats.find(fixedPoints)).second;
133  }
134 
136  int NumConstrainedPoints() const {
137  return (*mPointIntStats.find(constrainedPoints)).second;
138  }
139 
141  int NumFreePoints() const {
142  return (*mPointIntStats.find(freePoints)).second;
143  }
144 
146  int NumIgnoredPoints() const {
147  return (*mPointIntStats.find(ignoredPoints)).second;
148  }
149 
151  int NumEditLockedPoints() const {
152  return (*mPointIntStats.find(editLockedPoints)).second;
153  }
154 
156  int NumMeasures() const {
157  return (*mPointIntStats.find(totalMeasures)).second;
158  }
159 
161  int NumValidMeasures() const {
162  return (*mPointIntStats.find(validMeasures)).second;
163  }
164 
166  int NumIgnoredMeasures() const {
167  return (*mPointIntStats.find(ignoredMeasures)).second;
168  }
169 
171  int NumEditLockedMeasures() const {
172  return (*mPointIntStats.find(editLockedMeasures)).second;
173  }
174 
176  double GetAverageResidual() const {
177  return (*mPointDoubleStats.find(avgResidual)).second;
178  }
179 
181  double GetMinimumResidual() const {
182  return (*mPointDoubleStats.find(minResidual)).second;
183  }
184 
186  double GetMaximumResidual() const {
187  return (*mPointDoubleStats.find(maxResidual)).second;
188  }
189 
191  double GetMinLineResidual() const {
192  return (*mPointDoubleStats.find(minLineResidual)).second;
193  }
194 
196  double GetMinSampleResidual() const {
197  return (*mPointDoubleStats.find(minSampleResidual)).second;
198  }
199 
201  double GetMaxLineResidual() const {
202  return (*mPointDoubleStats.find(maxLineResidual)).second;
203  }
204 
206  double GetMaxSampleResidual() const {
207  return (*mPointDoubleStats.find(maxSampleResidual)).second;
208  }
209 
211  double GetMinLineShift() const {
212  return (*mPointDoubleStats.find(minLineShift)).second;
213  }
214 
216  double GetMaxLineShift() const {
217  return (*mPointDoubleStats.find(maxLineShift)).second;
218  }
219 
221  double GetMinSampleShift() const {
222  return (*mPointDoubleStats.find(minSampleShift)).second;
223  }
224 
226  double GetMaxSampleShift() const {
227  return (*mPointDoubleStats.find(maxSampleShift)).second;
228  }
229 
231  double GetMinPixelShift() const {
232  return (*mPointDoubleStats.find(minPixelShift)).second;
233  }
234 
236  double GetMaxPixelShift() const {
237  return (*mPointDoubleStats.find(maxPixelShift)).second;
238  }
239 
241  double GetAvgPixelShift() const {
242  return (*mPointDoubleStats.find(avgPixelShift)).second;
243  }
244 
245  protected:
249  QList<ControlCubeGraphNode *> mCubeGraphNodes;
250 
251  private:
252  std::map<int, int> mPointIntStats;
253  std::map<int, double> mPointDoubleStats;
254  std::map<QString, std::vector<double> > mImageMap;
255  std::map<QString, bool> mSerialNumMap;
256 
258  void GetPointIntStats();
259 
261  void GetPointDoubleStats();
262 
263  void UpdateMinMaxStats(const Statistics & stats,
264  ePointDoubleStats min,
265  ePointDoubleStats max);
266 
268  void InitPointDoubleStats();
269 
271  void InitSerialNumMap();
272 
273  int numCNetImages;
274 
275  Statistics mConvexHullStats, mConvexHullRatioStats;
276  };
277 }
278 #endif
ePointDoubleStats
Enumeration for Point stats like Tolerances, PixelShifts which have double data.
int NumValidPoints() const
Returns the Number of Valid (Not Ignored) Points in the Control Net.
std::map< int, int > mPointIntStats
Contains std::map of different count stats.
void GenerateImageStats()
Generate stats like Total, Ignored, Fixed Points in an Image.
std::map< QString, std::vector< double > > mImageMap
Contains stats by Image/Serial Num.
void GeneratePointStats(const QString &psPointFile)
Generate stats like Ignored, Fixed, Total Measures, Ignored by Control Point.
double GetAvgPixelShift() const
Get network Avg PixelShift.
int NumEditLockedPoints() const
Returns total number of edit locked points.
int NumIgnoredPoints() const
Returns the number of ignored points.
int NumFreePoints() const
Returns the number of Constrained Points in Control Net.
ControlNet * mCNet
Control Network.
double GetMinLineResidual() const
Determine the minimum line error of all points in the network.
ePointDetails
Enumeration for Point Statistics.
double GetMinSampleShift() const
Get network Min SampleShift.
std::vector< double > GetImageStatsBySerialNum(QString psSerialNum) const
Returns the Image Stats by Serial Number.
ImageStats
Enumeration for image stats.
int NumEditLockedMeasures() const
Returns total number of edit locked measures in the network.
double GetMinimumResidual() const
Determine the minimum error of all points in the network.
ePointIntStats
Enumeration for Point int stats for counts such as valid points, measures etc.
std::map< QString, bool > mSerialNumMap
Whether serial# is part of ControlNet.
void GetPointDoubleStats()
Get Point stats for Residuals and Shifts.
void InitPointDoubleStats()
Init Pointstats std::vector.
double GetMinPixelShift() const
Get network Min PixelShift.
double GetMaxSampleShift() const
Get network Max SampleShift.
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:109
void GetPointIntStats()
Get point count stats.
void InitSerialNumMap()
Init SerialNum std::map.
Program progress reporter.
Definition: Progress.h:58
ControlNetStatistics(ControlNet *pCNet, const QString &psSerialNumFile, Progress *pProgress=0)
Constructor.
a control network
Definition: ControlNet.h:207
std::map< int, double > mPointDoubleStats
Contains std::map of different computed stats.
Statistics mConvexHullRatioStats
min, max, average convex hull stats
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
int NumValidMeasures() const
Returns the total Number of valid Measures in the Control Net.
SerialNumberList mSerialNumList
Serial Number List.
void PrintImageStats(const QString &psImageFile)
Print the Image Stats into specified output file.
double GetMaximumResidual() const
Determine the maximum error of all points in the network.
double GetMinSampleResidual() const
Determine the minimum sample error of all points in the network.
int NumMeasures() const
Returns the total Number of Measures in the Control Net.
int NumConstrainedPoints() const
Returns the number of Constrained Points in Control Net.
double GetMaxLineShift() const
Get network Max LineShift.
Progress * mProgress
Progress state.
double GetMaxPixelShift() const
Get network Max PixelShift.
double GetMinLineShift() const
Get Min and Max LineShift.
Serial Number list generator.
double GetMaxLineResidual() const
Determine the maximum line error of all points in the network.
double GetMaxSampleResidual() const
Determine the maximum sample error of all points in the network.
double GetAverageResidual() const
Determine the average error of all points in the network.
int NumIgnoredMeasures() const
Returns the total Number of Ignored Measures in the Control Net.
int NumFixedPoints() const
Returns the Number of Fixed Points in the Control Net.
void GenerateControlNetStats(PvlGroup &pStatsGrp)
Generate the Control Net Stats into the PvlGroup.
Control Network Stats.

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:16:36