Isis 3 Programmer Reference
ControlNetStatistics.cpp
1 #include "ControlNetStatistics.h"
2 
3 #include <QDebug>
4 
5 #include <geos_c.h>
6 #include <geos/algorithm/ConvexHull.h>
7 #include <geos/geom/CoordinateSequence.h>
8 #include <geos/geom/CoordinateArraySequence.h>
9 #include <geos/geom/Envelope.h>
10 #include <geos/geom/Geometry.h>
11 #include <geos/geom/GeometryFactory.h>
12 #include <geos/geom/Polygon.h>
13 
14 #include "ControlNet.h"
15 #include "ControlPoint.h"
16 #include "ControlMeasure.h"
17 #include "ControlMeasureLogData.h"
18 #include "Cube.h"
19 #include "CubeManager.h"
20 #include "FileName.h"
21 #include "IString.h"
22 #include "Progress.h"
23 #include "Pvl.h"
24 #include "SpecialPixel.h"
25 #include "Statistics.h"
26 
27 namespace Isis {
28 
30  QString sPointType [] = { "Fixed", "Constrained", "Free" };
31 
33  QString sBoolean[] = { "False", "True" };
34 
44  ControlNetStatistics::ControlNetStatistics(ControlNet *pCNet, const QString &psSerialNumFile,
45  Progress *pProgress) {
46  numCNetImages = 0;
47  mCNet = pCNet;
48 
49  mSerialNumList = SerialNumberList(psSerialNumFile);
51 
52  mProgress = pProgress;
53 
57  }
58 
68  mCNet = pCNet;
69  mProgress = pProgress;
70 
73  }
74 
81  mCNet = NULL;
82  }
83 
90  int numSn = mSerialNumList.size();
91  numCNetImages = 0;
92  for (int i=0; i<numSn; i++) {
93  QString sn = mSerialNumList.serialNumber(i);
94  mSerialNumMap[sn] = false;
95  }
96  }
97 
109  pStatsGrp = PvlGroup("ControlNetSummary");
110  int numSN = mSerialNumList.size();
111 
112  if (numSN) {
113  pStatsGrp += PvlKeyword("TotalImages", toString(numSN));
114  pStatsGrp += PvlKeyword("ImagesInControlNet", toString(numCNetImages));
115  }
116 
117  pStatsGrp += PvlKeyword("TotalPoints", toString(mCNet->GetNumPoints()));
118  pStatsGrp += PvlKeyword("ValidPoints", toString(NumValidPoints()));
119  pStatsGrp += PvlKeyword("IgnoredPoints", toString(mCNet->GetNumPoints() - NumValidPoints()));
120  pStatsGrp += PvlKeyword("FixedPoints", toString(NumFixedPoints()));
121  pStatsGrp += PvlKeyword("ConstrainedPoints", toString(NumConstrainedPoints()));
122  pStatsGrp += PvlKeyword("FreePoints", toString(NumFreePoints()));
123  pStatsGrp += PvlKeyword("EditLockPoints", toString(mCNet->GetNumEditLockPoints()));
124 
125  pStatsGrp += PvlKeyword("TotalMeasures", toString(NumMeasures()));
126  pStatsGrp += PvlKeyword("ValidMeasures", toString(NumValidMeasures()));
127  pStatsGrp += PvlKeyword("IgnoredMeasures", toString(NumIgnoredMeasures()));
128  pStatsGrp += PvlKeyword("EditLockMeasures", toString(mCNet->GetNumEditLockMeasures()));
129 
130  double dValue = GetAverageResidual();
131  pStatsGrp += PvlKeyword("AvgResidual", (dValue == Null ? "Null" : toString(dValue)));
132 
133  dValue = GetMinimumResidual();
134  pStatsGrp += PvlKeyword("MinResidual", (dValue == Null ? "Null" : toString(dValue)));
135 
136  dValue = GetMaximumResidual();
137  pStatsGrp += PvlKeyword("MaxResidual", (dValue == Null ? "Null" : toString(dValue)));
138 
139  dValue = GetMinLineResidual();
140  pStatsGrp += PvlKeyword("MinLineResidual", (dValue == Null ? "Null" : toString(dValue)));
141 
142  dValue = GetMaxLineResidual();
143  pStatsGrp += PvlKeyword("MaxLineResidual", (dValue == Null ? "Null" : toString(dValue)));
144 
145  dValue = GetMinSampleResidual();
146  pStatsGrp += PvlKeyword("MinSampleResidual", (dValue == Null ? "Null" : toString(dValue)));
147 
148  dValue = GetMaxSampleResidual();
149  pStatsGrp += PvlKeyword("MaxSampleResidual", (dValue == Null ? "Null" : toString(dValue)));
150 
151  // Shifts - Line, Sample, Pixel
152  dValue = GetMinLineShift();
153  pStatsGrp += PvlKeyword("MinLineShift", (dValue == Null ? "Null" : toString(dValue)));
154 
155  dValue = GetMaxLineShift();
156  pStatsGrp += PvlKeyword("MaxLineShift", (dValue == Null ? "Null" : toString(dValue)));
157 
158  dValue = GetMinSampleShift();
159  pStatsGrp += PvlKeyword("MinSampleShift", (dValue == Null ? "Null" : toString(dValue)));
160 
161  dValue = GetMaxSampleShift();
162  pStatsGrp += PvlKeyword("MaxSampleShift", (dValue == Null ? "Null" : toString(dValue)));
163 
164  dValue = GetAvgPixelShift();
165  pStatsGrp += PvlKeyword("AvgPixelShift", (dValue == Null ? "NA" : toString(dValue)));
166 
167  dValue = GetMinPixelShift();
168  pStatsGrp += PvlKeyword("MinPixelShift", (dValue == Null ? "NA" : toString(dValue)));
169 
170  dValue = GetMaxPixelShift();
171  pStatsGrp += PvlKeyword("MaxPixelShift", (dValue == Null ? "NA" : toString(dValue)));
172 
173  dValue = mPointDoubleStats[minGFit];
174  pStatsGrp += PvlKeyword("MinGoodnessOfFit", (dValue == Null ? "NA" : toString(dValue)));
175 
176  dValue = mPointDoubleStats[maxGFit];
177  pStatsGrp += PvlKeyword("MaxGoodnessOfFit", (dValue == Null ? "NA" : toString(dValue)));
178 
179  dValue = mPointDoubleStats[minEccentricity];
180  pStatsGrp += PvlKeyword("MinEccentricity", (dValue == Null ? "NA" : toString(dValue)));
181 
182  dValue = mPointDoubleStats[maxEccentricity];
183  pStatsGrp += PvlKeyword("MaxEccentricity", (dValue == Null ? "NA" : toString(dValue)));
184 
185  dValue = mPointDoubleStats[minPixelZScore];
186  pStatsGrp += PvlKeyword("MinPixelZScore", (dValue == Null ? "NA" : toString(dValue)));
187 
188  dValue = mPointDoubleStats[maxPixelZScore];
189  pStatsGrp += PvlKeyword("MaxPixelZScore", (dValue == Null ? "NA" : toString(dValue)));
190 
191  // Convex Hull
192  if (mSerialNumList.size()) {
193  dValue = mConvexHullRatioStats.Minimum();
194  pStatsGrp += PvlKeyword("MinConvexHullRatio", (dValue == Null ? "Null" : toString(dValue)));
195 
196  dValue = mConvexHullRatioStats.Maximum();
197  pStatsGrp += PvlKeyword("MaxConvexHullRatio", (dValue == Null ? "Null" : toString(dValue)));
198 
199  dValue = mConvexHullRatioStats.Average();
200  pStatsGrp += PvlKeyword("AvgConvexHullRatio", (dValue == Null ? "Null" : toString(dValue)));
201  }
202  }
203 
204 
213  geos::geom::GeometryFactory geosFactory;
214 
215  CubeManager cubeMgr;
216  cubeMgr.SetNumOpenCubes(50);
217 
218  QList<QString> cnetSerials = mCNet->GetCubeSerials();
219 
220  if (mProgress != NULL) {
221  mProgress->SetText("Generating Image Stats.....");
222  mProgress->SetMaximumSteps(cnetSerials.size());
224  }
225 
226  foreach (QString sn, cnetSerials) {
227  geos::geom::CoordinateSequence * ptCoordinates =
228  new geos::geom::CoordinateArraySequence();
229 
230  // setup vector for number of image properties and init to 0
231  QVector<double> imgStats(numImageStats, 0);
232 
233  // Open the cube to get the dimensions
234  Cube *cube = cubeMgr.OpenCube(mSerialNumList.fileName(sn));
235 
236  mSerialNumMap[sn] = true;
237  numCNetImages++;
238 
239  imgStats[imgSamples] = cube->sampleCount();
240  imgStats[imgLines] = cube->lineCount();
241  double cubeArea = imgStats[imgSamples] * imgStats[imgLines];
242 
244 
245  // Populate pts with a list of control points
246  if (!measures.isEmpty()) {
247  foreach (ControlMeasure * measure, measures) {
248  ControlPoint *parentPoint = measure->Parent();
249  imgStats[imgTotalPoints]++;
250  if (parentPoint->IsIgnored()) {
251  imgStats[imgIgnoredPoints]++;
252  }
253  if (parentPoint->GetType() == ControlPoint::Fixed) {
254  imgStats[imgFixedPoints]++;
255  }
256  if (parentPoint->GetType() == ControlPoint::Constrained) {
257  imgStats[imgConstrainedPoints]++;
258  }
259  if (parentPoint->GetType() == ControlPoint::Free) {
260  imgStats[imgFreePoints]++;
261  }
262  if (parentPoint->IsEditLocked()) {
263  imgStats[imgLockedPoints]++;
264  }
265  if (measure->IsEditLocked()) {
266  imgStats[imgLocked]++;
267  }
268  ptCoordinates->add(geos::geom::Coordinate(measure->GetSample(),
269  measure->GetLine()));
270  }
271 
272  ptCoordinates->add(geos::geom::Coordinate(measures[0]->GetSample(),
273  measures[0]->GetLine()));
274  }
275 
276  if (ptCoordinates->size() >= 4) {
277  // Calculate the convex hull
278 
279  // Even though geos doesn't create valid linear rings/polygons from this set of coordinates,
280  // because it self-intersects many many times, it still correctly does a convex hull
281  // calculation on the points in the polygon.
282  geos::geom::Geometry * convexHull = geosFactory.createPolygon(
283  geosFactory.createLinearRing(ptCoordinates), 0)->convexHull();
284 
285  // Calculate the area of the convex hull
286  imgStats[imgConvexHullArea] = convexHull->getArea();
287  imgStats[imgConvexHullRatio] = imgStats[imgConvexHullArea] / cubeArea;
288  }
289 
290  // Add info to statistics to get min, max and avg convex hull
291  mConvexHullStats.AddData(imgStats[imgConvexHullArea]);
292  mConvexHullRatioStats.AddData(imgStats[imgConvexHullRatio]);
293 
294  mImageMap[sn] = imgStats;
295 
296  delete ptCoordinates;
297  ptCoordinates = NULL;
298 
299  // Update Progress
300  if (mProgress != NULL)
302  }
303  }
304 
305 
315  void ControlNetStatistics::PrintImageStats(const QString &psImageFile) {
316  // Check if the image list has been provided
317  if (!mSerialNumList.size()) {
318  QString msg = "Serial Number of Images has not been provided to get Image Stats";
320  }
321 
322  FileName outFile(psImageFile);
323  ofstream ostm;
324  QString outName(outFile.expanded());
325  ostm.open(outName.toLatin1().data(), std::ios::out);
326 
327  if ( ostm.fail() ) {
328  QString msg = QObject::tr("Cannot open file [%1]").arg(psImageFile);
329  throw IException(IException::Io, msg, _FILEINFO_);
330  }
331 
332  //map< QString, vector<double> >::iterator it;
333  // imgSamples, imgLines, imgTotalPoints, imgIgnoredPoints, imgFixedPoints, imgLockedPoints, imgLocked, imgConstrainedPoints, imgFreePoints, imgConvexHullArea, imgConvexHullRatio
335  // Log into the output file
336  ostm << "Filename, SerialNumber, TotalPoints, PointsIgnored, PointsEditLocked, Fixed, Constrained, Free, ConvexHullRatio" << endl;
337  //for (it = mImageMap.begin(); it != mImageMap.end(); it++) {
338 
339  for (it = mSerialNumMap.begin(); it != mSerialNumMap.end(); it++) {
340  ostm << mSerialNumList.fileName(it.key()) << ", " << it.key() << ", ";
341  bool serialNumExists = it.value();
342  if (serialNumExists) {
343  QVector<double> imgStats = mImageMap[(it).key()] ;
344  ostm << imgStats[imgTotalPoints]<< ", " << imgStats[imgIgnoredPoints] << ", " ;
345  ostm << imgStats[imgLockedPoints] << ", " << imgStats[imgFixedPoints] << ", " ;
346  ostm << imgStats[imgConstrainedPoints] << ", " << imgStats[imgFreePoints] << ", ";
347  ostm << imgStats[imgConvexHullRatio] << endl;
348  }
349  else {
350  ostm << "0, 0, 0, 0, 0, 0, 0" << endl;
351  }
352  }
353 
354  if (!ostm) {
355  QString msg = QObject::tr("Error writing to file: [%1]").arg(psImageFile);
356  throw IException(IException::Io, msg, _FILEINFO_);
357  }
358  ostm.close();
359  }
360 
361 
372  return (mImageMap.find(psSerialNum)).value();
373  }
374 
375 
385  void ControlNetStatistics::GeneratePointStats(const QString &psPointFile) {
386  Isis::FileName outFile(psPointFile);
387 
388  ofstream ostm;
389  QString outName(outFile.expanded());
390  ostm.open(outName.toLatin1().data(), std::ios::out);
391 
392  if ( ostm.fail() ) {
393  QString msg = QObject::tr("Cannot open file [%1]").arg(psPointFile);
394  throw IException(IException::Io, msg, _FILEINFO_);
395  }
396 
397  ostm << " PointId, PointType, PointIgnore, PointEditLock, TotalMeasures, MeasuresValid, MeasuresIgnore, MeasuresEditLock," << endl;
398 
399  int iNumPoints = mCNet->GetNumPoints();
400 
401  // Initialise the Progress object
402  if (mProgress != NULL && iNumPoints > 0) {
403  mProgress->SetText("Point Stats: Loading Control Points...");
404  mProgress->SetMaximumSteps(iNumPoints);
406  }
407 
408  for (int i = 0; i < iNumPoints; i++) {
409  const ControlPoint *cPoint = mCNet->GetPoint(i);
410  int iNumMeasures = cPoint->GetNumMeasures();
411  int iValidMeasures = cPoint->GetNumValidMeasures();
412  int iIgnoredMeasures = iNumMeasures - iValidMeasures;
413 
414  // Log into the output file
415  ostm << cPoint->GetId() << ", " << sPointType[(int)cPoint->GetType()] << ", " << sBoolean[(int)cPoint->IsIgnored()] << ", " ;
416  ostm << sBoolean[(int)cPoint->IsEditLocked()] << ", " << iNumMeasures << ", " << iValidMeasures << ", ";
417  ostm << iIgnoredMeasures << ", " << cPoint->GetNumLockedMeasures() << endl;
418 
419  // Update Progress
420  if (mProgress != NULL)
422  }
423 
424  if (!ostm) {
425  QString msg = QObject::tr("Error writing to file: [%1]").arg(psPointFile);
426  throw IException(IException::Io, msg, _FILEINFO_);
427  }
428 
429  ostm.close();
430  }
431 
432 
439  // Init all the entries
440  // totalPoints, validPoints, ignoredPoints, fixedPoints, constrainedPoints, editLockedPoints,
441  // totalMeasures, validMeasures, ignoredMeasures, editLockedMeasures
442  for (int i=0; i<numPointIntStats; i++) {
443  mPointIntStats[i] = 0;
444  }
445 
446  int iNumPoints = mCNet->GetNumPoints();
447 
448  // totalPoints
449  mPointIntStats[totalPoints] = iNumPoints;
450 
451  for (int i = 0; i < iNumPoints; i++) {
452  if (!mCNet->GetPoint(i)->IsIgnored()) {
453  // validPoints
454  mPointIntStats[validPoints]++;
455  }
456  else {
457  // ignoredPoints
458  mPointIntStats[ignoredPoints]++;
459  }
460 
461  // fixedPoints
462  if (mCNet->GetPoint(i)->GetType() == ControlPoint::Fixed)
463  mPointIntStats[fixedPoints]++;
464 
465  // constrainedPoints
466  if (mCNet->GetPoint(i)->GetType() == ControlPoint::Constrained)
467  mPointIntStats[constrainedPoints]++;
468 
469  // free points
470  if (mCNet->GetPoint(i)->GetType() == ControlPoint::Free)
471  mPointIntStats[freePoints]++;
472 
473  // editLockedPoints
474  if (mCNet->GetPoint(i)->IsEditLocked()) {
475  mPointIntStats[editLockedPoints]++;
476  }
477 
478  // totalMeasures
479  mPointIntStats[totalMeasures] += mCNet->GetPoint(i)->GetNumMeasures();
480 
481  // validMeasures
482  mPointIntStats[validMeasures] += mCNet->GetPoint(i)->GetNumValidMeasures();
483 
484  // editLockedMeasures
485  mPointIntStats[editLockedMeasures] += mCNet->GetPoint(i)->GetNumLockedMeasures();
486  }
487  // ignoredMeasures
488  mPointIntStats[ignoredMeasures] = mPointIntStats[totalMeasures] - mPointIntStats[validMeasures];
489  }
490 
491 
498  for (int i = 0; i < numPointDblStats; i++) {
499  mPointDoubleStats[i] = Null;
500  }
501  }
502 
503 
512 
513  int iNumPoints = mCNet->GetNumPoints();
514  double dValue = 0;
515 
516  Statistics residualMagStats;
517  Statistics pixelShiftStats;
518 
519  for (int i = 0; i < iNumPoints; i++) {
520  ControlPoint * cp = mCNet->GetPoint(i);
521 
522  if (!cp->IsIgnored()) {
523  for (int cmIndex = 0; cmIndex < cp->GetNumMeasures(); cmIndex++) {
524  ControlMeasure *cm = cp->GetMeasure(cmIndex);
525 
526  if (!cm->IsIgnored()) {
527  residualMagStats.AddData(cm->GetResidualMagnitude());
528 
529  if (!IsSpecial(cm->GetPixelShift()))
530  pixelShiftStats.AddData(fabs(cm->GetPixelShift()));
531  }
532  }
533  }
534 
535  Statistics resMagStats = cp->GetStatistic(
537  UpdateMinMaxStats(resMagStats, minResidual, maxResidual);
538 
539  Statistics resLineStats = cp->GetStatistic(
540  &ControlMeasure::GetLineResidual);
541  UpdateMinMaxStats(resLineStats, minLineResidual, maxLineResidual);
542 
543  Statistics resSampStats = cp->GetStatistic(
544  &ControlMeasure::GetSampleResidual);
545  UpdateMinMaxStats(resSampStats, minSampleResidual, maxSampleResidual);
546 
547  Statistics pixShiftStats = cp->GetStatistic(
548  &ControlMeasure::GetPixelShift);
549  UpdateMinMaxStats(pixShiftStats, minPixelShift, maxPixelShift);
550 
551  Statistics lineShiftStats = cp->GetStatistic(
552  &ControlMeasure::GetLineShift);
553  UpdateMinMaxStats(lineShiftStats, minLineShift, maxLineShift);
554 
555  Statistics sampShiftStats = cp->GetStatistic(
556  &ControlMeasure::GetSampleShift);
557  UpdateMinMaxStats(sampShiftStats, minSampleShift, maxSampleShift);
558 
559  Statistics gFitStats = cp->GetStatistic(
561  UpdateMinMaxStats(gFitStats, minGFit, maxGFit);
562 
563  Statistics minPixelZScoreStats = cp->GetStatistic(
565 
566  if (minPixelZScoreStats.ValidPixels()) {
567  dValue = fabs(minPixelZScoreStats.Minimum());
568  if (mPointDoubleStats[minPixelZScore] > dValue)
569  mPointDoubleStats[minPixelZScore] = dValue;
570  }
571 
572  Statistics maxPixelZScoreStats = cp->GetStatistic(
574 
575  if (maxPixelZScoreStats.ValidPixels()) {
576  dValue = fabs(maxPixelZScoreStats.Maximum());
577  if (mPointDoubleStats[maxPixelZScore] > dValue)
578  mPointDoubleStats[maxPixelZScore] = dValue;
579  }
580  }
581 
582  // Average Residuals
583  mPointDoubleStats[avgResidual] = residualMagStats.Average();
584 
585  // Average Shift
586  mPointDoubleStats[avgPixelShift] = pixelShiftStats.Average();
587  }
588 
589 
590  void ControlNetStatistics::UpdateMinMaxStats(const Statistics & stats,
591  ePointDoubleStats min, ePointDoubleStats max) {
592  if (stats.ValidPixels()) {
593  if (mPointDoubleStats[min] != Null) {
594  mPointDoubleStats[min] = qMin(
595  mPointDoubleStats[min], fabs(stats.Minimum()));
596  }
597  else {
598  mPointDoubleStats[min] = fabs(stats.Minimum());
599  }
600 
601  if (mPointDoubleStats[max] != Null) {
602  mPointDoubleStats[max] = qMax(
603  mPointDoubleStats[max], fabs(stats.Maximum()));
604  }
605  else {
606  mPointDoubleStats[max] = fabs(stats.Maximum());
607  }
608  }
609  }
610 }
int NumValidPoints() const
Returns the Number of Valid (Not Ignored) Points in the Control Net.
QMap< QString, bool > mSerialNumMap
Whether serial# is part of ControlNet.
void GenerateImageStats()
Generate stats like Total, Ignored, Fixed Points in an Image.
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:110
int NumMeasures() const
Returns the total Number of Measures in the Control Net.
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:101
double GetMinLineShift() const
Get Min and Max LineShift.
int NumFreePoints() const
Returns the number of Constrained Points in Control Net.
void GeneratePointStats(const QString &psPointFile)
Generate stats like Ignored, Fixed, Total Measures, Ignored by Control Point.
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
Definition: ControlPoint.h:391
A Fixed point is a Control Point whose lat/lon is well established and should not be changed...
Definition: ControlPoint.h:386
File name manipulation and expansion.
Definition: FileName.h:116
double GetMinSampleResidual() const
Determine the minimum sample error of all points in the network.
double Minimum() const
Returns the absolute minimum double found in all data passed through the AddData method.
Definition: Statistics.cpp:395
double GetMaxLineResidual() const
Determine the maximum line error of all points in the network.
QMap< int, int > mPointIntStats
Contains QMap of different count stats.
ControlNet * mCNet
Control Network.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube&#39;s serial number.
double GetMaxSampleResidual() const
Determine the maximum sample error of all points in the network.
int sampleCount() const
Definition: Cube.cpp:1452
QString serialNumber(const QString &filename)
Return a serial number given a filename.
double GetMaximumResidual() const
Determine the maximum error of all points in the network.
double GetResidualMagnitude() const
Return Residual magnitude.
double GetMinimumResidual() const
Determine the minimum error of all points in the network.
QString sPointType[]
String names for Point Type.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
BigInt ValidPixels() const
Returns the total number of valid pixels processed.
Definition: Statistics.cpp:446
QVector< double > GetImageStatsBySerialNum(QString psSerialNum) const
Returns the Image Stats by Serial Number.
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:171
int GetNumValidMeasures() const
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:121
void GetPointDoubleStats()
Get Point stats for Residuals and Shifts.
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
A Free point is a Control Point that identifies common measurements between two or more cubes...
Definition: ControlPoint.h:399
Control measures store z-scores in pairs.
void InitPointDoubleStats()
Init Pointstats std::vector.
QString fileName(const QString &sn)
Return a filename given a serial number.
void SetNumOpenCubes(unsigned int numCubes)
This sets the maximum number of opened cubes for this instance of CubeManager.
Definition: CubeManager.h:96
int NumValidMeasures() const
Returns the total Number of valid Measures in the Control Net.
double GetMaxPixelShift() const
Get network Max PixelShift.
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
Definition: Statistics.cpp:416
int GetNumPoints() const
Return the number of control points in the network.
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
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:271
int GetNumLockedMeasures() const
Returns the number of locked control measures.
Statistics mConvexHullRatioStats
min, max, average convex hull stats
QString GetId() const
Return the Id of the control point.
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:77
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
int NumIgnoredMeasures() const
Returns the total Number of Ignored Measures in the Control Net.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
double GetAverageResidual() const
Determine the average error of all points in the network.
A type of error that could only have occurred due to a mistake on the user&#39;s part (e...
Definition: IException.h:142
A single keyword-value pair.
Definition: PvlKeyword.h:98
QList< QString > GetCubeSerials() const
Use this method to get a complete list of all the cube serial numbers in the network.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:212
double GetMinPixelShift() const
Get network Min PixelShift.
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:212
A single control point.
Definition: ControlPoint.h:369
SerialNumberList mSerialNumList
Serial Number List.
void PrintImageStats(const QString &psImageFile)
Print the Image Stats into specified output file.
int NumFixedPoints() const
Returns the Number of Fixed Points in the Control Net.
QString sBoolean[]
String values for Boolean.
Class for quick re-accessing of cubes based on file name.
Definition: CubeManager.h:64
int GetNumEditLockMeasures()
Return the total number of edit locked measures for all control points in the network.
int size() const
How many serial number / filename combos are in the list.
GoodnessOfFit is pointreg information for reference measures.
QMap< QString, QVector< double > > mImageMap
Contains stats by Image/Serial Num.
int NumConstrainedPoints() const
Returns the number of Constrained Points in Control Net.
double GetMaxSampleShift() const
Get network Max SampleShift.
int GetNumEditLockPoints()
Returns the number of edit locked control points.
double GetMinSampleShift() const
Get network Min SampleShift.
QList< ControlMeasure *> GetMeasuresInCube(QString serialNumber)
Get all the measures pertaining to a given cube serial number.
int lineCount() const
Definition: Cube.cpp:1379
Progress * mProgress
Progress state.
double GetMaxLineShift() const
Get network Max LineShift.
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
a control measurement
double GetMinLineResidual() const
Determine the minimum line error of all points in the network.
PointType GetType() const
QMap< int, double > mPointDoubleStats
Contains QMap of different computed stats.
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:154
Serial Number list generator.
double GetAvgPixelShift() const
Get network Avg PixelShift.
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:313
Cube * OpenCube(const QString &cubeFileName)
This method opens a cube.
Definition: CubeManager.cpp:89
void GenerateControlNetStats(PvlGroup &pStatsGrp)
Generate the Control Net Stats into the PvlGroup.
IO Handler for Isis Cubes.
Definition: Cube.h:170