Isis 3 Programmer Reference
Statistics.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include "Statistics.h"
8 
9 #include <QDataStream>
10 #include <QDebug>
11 #include <QString>
12 #include <QUuid>
13 #include <QXmlStreamWriter>
14 
15 #include <float.h>
16 
17 #include "IException.h"
18 #include "IString.h"
19 #include "Project.h"
20 #include "PvlGroup.h"
21 #include "PvlKeyword.h"
22 #include "XmlStackedHandlerReader.h"
23 
24 using namespace std;
25 
26 namespace Isis {
28  Statistics::Statistics(QObject *parent) : QObject(parent) {
29 // m_id = NULL;
30 // m_id = new QUuid(QUuid::createUuid());
31  SetValidRange();
32  Reset(); // initialize
33  }
34 
35 
36  Statistics::Statistics(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent) { // TODO: does xml stuff need project???
37 // m_id = NULL;
38  SetValidRange();
39  Reset(); // initialize
40  xmlReader->pushContentHandler(new XmlHandler(this, project)); // TODO: does xml stuff need project???
41  }
42 
48  Statistics::Statistics(const PvlGroup &inStats, QObject *parent) {
49  SetValidRange();
50  Reset();
51  fromPvl(inStats);
52  }
53 
54 
56  : m_sum(other.m_sum),
57  m_sumsum(other.m_sumsum),
58  m_minimum(other.m_minimum),
59  m_maximum(other.m_maximum),
60  m_validMinimum(other.m_validMinimum),
61  m_validMaximum(other.m_validMaximum),
62  m_totalPixels(other.m_totalPixels),
63  m_validPixels(other.m_validPixels),
64  m_nullPixels(other.m_nullPixels),
65  m_lrsPixels(other.m_lrsPixels),
66  m_lisPixels(other.m_lisPixels),
67  m_hrsPixels(other.m_hrsPixels),
68  m_hisPixels(other.m_hisPixels),
69  m_underRangePixels(other.m_underRangePixels),
70  m_overRangePixels(other.m_overRangePixels),
71  m_removedData(other.m_removedData) {
72  }
73  // : m_id(new QUuid(other.m_id->toString())),
74 
75 
78 // delete m_id;
79 // m_id = NULL;
80  }
81 
82 
83  Statistics &Statistics::operator=(const Statistics &other) {
84 
85  if (&other != this) {
86 // delete m_id;
87 // m_id = NULL;
88 // m_id = new QUuid(other.m_id->toString());
89 
90  m_sum = other.m_sum;
91  m_sumsum = other.m_sumsum;
92  m_minimum = other.m_minimum;
93  m_maximum = other.m_maximum;
98  m_nullPixels = other.m_nullPixels;
99  m_lrsPixels = other.m_lrsPixels;
100  m_lisPixels = other.m_lisPixels;
101  m_hrsPixels = other.m_hrsPixels;
102  m_hisPixels = other.m_hisPixels;
106  }
107  return *this;
108 
109  }
110 
111 
114  m_sum = 0.0;
115  m_sumsum = 0.0;
116  m_minimum = DBL_MAX;
117  m_maximum = -DBL_MAX;
118  m_totalPixels = 0;
119  m_validPixels = 00;
120  m_nullPixels = 0;
121  m_lisPixels = 0;
122  m_lrsPixels = 0;
123  m_hrsPixels = 0;
124  m_hisPixels = 0;
125  m_overRangePixels = 0;
126  m_underRangePixels = 0;
127  m_removedData = false;
128  }
129 
130 
141  void Statistics::AddData(const double *data, const unsigned int count) {
142  for(unsigned int i = 0; i < count; i++) {
143  double value = data[i];
144  AddData(value);
145  }
146  }
147 
148 
158  void Statistics::AddData(const double data) {
159  m_totalPixels++;
160 
161  if (Isis::IsNullPixel(data)) {
162  m_nullPixels++;
163  }
164  else if (Isis::IsHisPixel(data)) {
165  m_hisPixels++;
166  }
167  else if (Isis::IsHrsPixel(data)) {
168  m_hrsPixels++;
169  }
170  else if (Isis::IsLisPixel(data)) {
171  m_lisPixels++;
172  }
173  else if (Isis::IsLrsPixel(data)) {
174  m_lrsPixels++;
175  }
176  else if (AboveRange(data)) {
178  }
179  else if (BelowRange(data)) {
181  }
182  else { // if (Isis::IsValidPixel(data) && InRange(data)) {
183  m_sum += data;
184  m_sumsum += data * data;
185  if (data < m_minimum) m_minimum = data;
186  if (data > m_maximum) m_maximum = data;
187  m_validPixels++;
188  }
189 
190  }
191 
192 
206  void Statistics::RemoveData(const double *data, const unsigned int count) {
207 
208  for(unsigned int i = 0; i < count; i++) {
209  double value = data[i];
210  RemoveData(value);
211  }
212 
213  }
214 
215 
216  void Statistics::RemoveData(const double data) {
217  m_removedData = true;
218  m_totalPixels--;
219 
220  if (Isis::IsNullPixel(data)) {
221  m_nullPixels--;
222  }
223  else if (Isis::IsHisPixel(data)) {
224  m_hisPixels--;
225  }
226  else if (Isis::IsHrsPixel(data)) {
227  m_hrsPixels--;
228  }
229  else if (Isis::IsLisPixel(data)) {
230  m_lisPixels--;
231  }
232  else if (Isis::IsLrsPixel(data)) {
233  m_lrsPixels--;
234  }
235  else if (AboveRange(data)) {
237  }
238  else if (BelowRange(data)) {
240  }
241  else { // if (IsValidPixel(data) && InRange(data)) {
242  m_sum -= data;
243  m_sumsum -= data * data;
244  m_validPixels--;
245  }
246 
247  if (m_totalPixels < 0) {
248  QString msg = "You are removing non-existant data in [Statistics::RemoveData]";
249  throw IException(IException::Programmer, msg, _FILEINFO_);
250  }
251  // what happens to saved off min/max???
252  }
253 
254 
255  void Statistics::SetValidRange(const double minimum, const double maximum) {
256  m_validMinimum = minimum;
257  m_validMaximum = maximum;
258 
260  // get the min and max DN values in the chosen range
261  QString msg = "Invalid Range: Minimum [" + toString(minimum)
262  + "] must be less than the Maximum [" + toString(maximum) + "].";
263  throw IException(IException::Programmer, msg, _FILEINFO_);
264  }
265  //??? throw exception if data has already been added???
266  }
267 
268 
269  double Statistics::ValidMinimum() const {
270  return m_validMinimum;
271  }
272 
273 
274  double Statistics::ValidMaximum() const {
275  return m_validMaximum;
276  }
277 
278 
279  bool Statistics::InRange(const double value) {
280  return (!BelowRange(value) && !AboveRange(value));
281  }
282 
283 
284  bool Statistics::AboveRange(const double value) {
285  return (value > m_validMaximum);
286  }
287 
288 
289  bool Statistics::BelowRange(const double value) {
290  return (value < m_validMinimum);
291  }
292 
293 
300  double Statistics::Average() const {
301  if (m_validPixels < 1) return Isis::NULL8;
302  return m_sum / m_validPixels;
303  }
304 
305 
313  if (m_validPixels <= 1) return Isis::NULL8;
314  return sqrt(Variance());
315  }
316 
317 
328  double Statistics::Variance() const {
329  if (m_validPixels <= 1) return Isis::NULL8;
330  double temp = m_validPixels * m_sumsum - m_sum * m_sum;
331  if (temp < 0.0) temp = 0.0; // This should happen unless roundoff occurs
332  return temp / ((m_validPixels - 1.0) * m_validPixels);
333  }
334 
335 
341  double Statistics::Sum() const {
342  return m_sum;
343  }
344 
345 
351  double Statistics::SumSquare() const {
352  return m_sumsum;
353  }
354 
355 
365  double Statistics::Rms() const {
366  if (m_validPixels < 1) return Isis::NULL8;
367  double temp = m_sumsum / m_validPixels;
368  if (temp < 0.0) temp = 0.0;
369  return sqrt(temp);
370  }
371 
372 
382  double Statistics::Minimum() const {
383  if (m_removedData) {
384  QString msg = "Minimum is invalid since you removed data";
385  throw IException(IException::Programmer, msg, _FILEINFO_);
386  }
387 
388  if (m_validPixels < 1) return Isis::NULL8;
389  return m_minimum;
390  }
391 
392 
403  double Statistics::Maximum() const {
404  if (m_removedData) {
405  QString msg = "Maximum is invalid since you removed data";
406  throw IException(IException::Programmer, msg, _FILEINFO_);
407  }
408 
409  if (m_validPixels < 1) return Isis::NULL8;
410  return m_maximum;
411  }
412 
413 
421  return m_totalPixels;
422  }
423 
424 
434  return m_validPixels;
435  }
436 
437 
445  return m_overRangePixels;
446  }
447 
448 
456  return m_underRangePixels;
457  }
458 
459 
466  return m_nullPixels;
467  }
468 
469 
477  return m_lisPixels;
478  }
479 
480 
488  return m_lrsPixels;
489  }
490 
491 
499  return m_hisPixels;
500  }
501 
502 
510  return m_hrsPixels;
511  }
512 
513 
522  }
523 
524 
525  bool Statistics::RemovedData() const {
526  return m_removedData;
527  }
528 
529 
545  double Statistics::ChebyshevMinimum(const double percent) const {
546  if ((percent <= 0.0) || (percent >= 100.0)) {
547  QString msg = "Invalid value for percent";
548  throw IException(IException::Programmer, msg, _FILEINFO_);
549  }
550 
551  if (m_validPixels < 1) return Isis::NULL8;
552  double k = sqrt(1.0 / (1.0 - percent / 100.0));
553  return Average() - k * StandardDeviation();
554  }
555 
556 
572  double Statistics::ChebyshevMaximum(const double percent) const {
573  if ((percent <= 0.0) || (percent >= 100.0)) {
574  QString msg = "Invalid value for percent";
575  throw IException(IException::Programmer, msg, _FILEINFO_);
576  }
577 
578  if (m_validPixels < 1) return Isis::NULL8;
579  double k = sqrt(1.0 / (1.0 - percent / 100.0));
580  return Average() + k * StandardDeviation();
581  }
582 
583 
598  double Statistics::BestMinimum(const double percent) const {
599  if (m_validPixels < 1) return Isis::NULL8;
600  // ChebyshevMinimum can return erroneous values when the data is all a
601  // single value
602  // In this case, we just want to return the minimum
603  if (Minimum() == Maximum()) return Minimum();
604  double min = ChebyshevMinimum(percent);
605  if (Minimum() > min) min = Minimum();
606  return min;
607  }
608 
609 
625  double Statistics::BestMaximum(const double percent) const {
626  if (m_validPixels < 1) return Isis::NULL8;
627  // ChebyshevMaximum can return erroneous values when the data is all a
628  // single value
629  // In this case, we just want to return the maximum
630  if (Minimum() == Maximum()) return Maximum();
631  double max = ChebyshevMaximum(percent);
632  if (Maximum() < max) max = Maximum();
633  return max;
634  }
635 
636 
649  double Statistics::ZScore(const double value) const {
650  if (StandardDeviation() == 0) {
651  if (value == Maximum()) return 0;
652  else {
653  QString msg = "Undefined Z-score. Standard deviation is zero and the input value["
654  + toString(value) + "] is out of range [" + toString(Maximum()) + "].";
655  throw IException(IException::Programmer, msg, _FILEINFO_);
656  }
657  }
658  return (value - Average()) / StandardDeviation();
659  }
660 
661 
667  void Statistics::fromPvl(const PvlGroup &inStats) {
668  Reset();
669  m_sum = inStats["Sum"];
670  m_sumsum = inStats["SumSquare"];
671  m_minimum = inStats["Minimum"];
672  m_maximum = inStats["Maximum"];
673  m_validMinimum = inStats["ValidMinimum"];
674  m_validMaximum = inStats["ValidMaximum"];
675  m_totalPixels = inStats["TotalPixels"];
676  m_validPixels = inStats["ValidPixels"];
677  m_nullPixels = inStats["NullPixels"];
678  m_lrsPixels = inStats["LrsPixels"];
679  m_lisPixels = inStats["LisPixels"];
680  m_hrsPixels = inStats["HrsPixels"];
681  m_hisPixels = inStats["HisPixels"];
682  m_underRangePixels = inStats["UnderValidMinimumPixels"];
683  m_overRangePixels = inStats["OverValidMaximumPixels"];
684  m_removedData = false; //< Is this the correct state?
685  }
686 
687 
695  PvlGroup Statistics::toPvl(QString name) const {
696  if (name.isEmpty()) {
697  name = "Statistics";
698  }
699  // Construct a label with the results
700  PvlGroup results(name);
701  results += PvlKeyword("Sum", toString(Sum()));
702  results += PvlKeyword("SumSquare", toString(SumSquare()));
703  results += PvlKeyword("Minimum", toString(Minimum()));
704  results += PvlKeyword("Maximum", toString(Maximum()));
705  results += PvlKeyword("ValidMinimum", toString(ValidMinimum()));
706  results += PvlKeyword("ValidMaximum", toString(ValidMaximum()));
707  if (ValidPixels() != 0) {
708  results += PvlKeyword("Average", toString(Average()));
709  results += PvlKeyword("StandardDeviation", toString(StandardDeviation()));
710  results += PvlKeyword("Variance", toString(Variance()));
711  }
712  results += PvlKeyword("TotalPixels", toString(TotalPixels()));
713  results += PvlKeyword("ValidPixels", toString(ValidPixels()));
714  results += PvlKeyword("OverValidMaximumPixels", toString(OverRangePixels()));
715  results += PvlKeyword("UnderValidMinimumPixels", toString(UnderRangePixels()));
716  results += PvlKeyword("NullPixels", toString(NullPixels()));
717  results += PvlKeyword("LisPixels", toString(LisPixels()));
718  results += PvlKeyword("LrsPixels", toString(LrsPixels()));
719  results += PvlKeyword("HisPixels", toString(HisPixels()));
720  results += PvlKeyword("HrsPixels", toString(HrsPixels()));
721 
722  return results;
723  }
724 
725 
726  void Statistics::save(QXmlStreamWriter &stream, const Project *project) const { // TODO: does xml stuff need project???
727 
728  stream.writeStartElement("statistics");
729 // stream.writeTextElement("id", m_id->toString());
730 
731  stream.writeTextElement("sum", toString(m_sum));
732  stream.writeTextElement("sumSquares", toString(m_sumsum));
733 
734  stream.writeStartElement("range");
735  stream.writeTextElement("minimum", toString(m_minimum));
736  stream.writeTextElement("maximum", toString(m_maximum));
737  stream.writeTextElement("validMinimum", toString(m_validMinimum));
738  stream.writeTextElement("validMaximum", toString(m_validMaximum));
739  stream.writeEndElement(); // end range
740 
741  stream.writeStartElement("pixelCounts");
742  stream.writeTextElement("totalPixels", toString(m_totalPixels));
743  stream.writeTextElement("validPixels", toString(m_validPixels));
744  stream.writeTextElement("nullPixels", toString(m_nullPixels));
745  stream.writeTextElement("lisPixels", toString(m_lisPixels));
746  stream.writeTextElement("lrsPixels", toString(m_lrsPixels));
747  stream.writeTextElement("hisPixels", toString(m_hisPixels));
748  stream.writeTextElement("hrsPixels", toString(m_hrsPixels));
749  stream.writeTextElement("underRangePixels", toString(m_underRangePixels));
750  stream.writeTextElement("overRangePixels", toString(m_overRangePixels));
751  stream.writeEndElement(); // end pixelCounts
752 
753  stream.writeTextElement("removedData", toString(m_removedData));
754  stream.writeEndElement(); // end statistics
755 
756  }
757 
758 
759  Statistics::XmlHandler::XmlHandler(Statistics *statistics, Project *project) { // TODO: does xml stuff need project???
760  m_xmlHandlerStatistics = statistics;
761  m_xmlHandlerProject = project; // TODO: does xml stuff need project???
762  m_xmlHandlerCharacters = "";
763  }
764 
765 
766  Statistics::XmlHandler::~XmlHandler() {
767  // do not delete this pointer... we don't own it, do we??? passed into StatCumProbDistDynCalc constructor as pointer
768  // delete m_xmlHandlerProject; // TODO: does xml stuff need project???
769  m_xmlHandlerProject = NULL;
770  }
771 
772 
773  bool Statistics::XmlHandler::startElement(const QString &namespaceURI,
774  const QString &localName,
775  const QString &qName,
776  const QXmlAttributes &atts) {
777  m_xmlHandlerCharacters = "";
778  if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
779  // no element attibutes to evaluate
780  }
781  return true;
782  }
783 
784 
785  bool Statistics::XmlHandler::characters(const QString &ch) {
786  m_xmlHandlerCharacters += ch;
787  return XmlStackedHandler::characters(ch);
788  }
789 
790 
791  bool Statistics::XmlHandler::endElement(const QString &namespaceURI, const QString &localName,
792  const QString &qName) {
793  if (!m_xmlHandlerCharacters.isEmpty()) {
794  if (localName == "id") {
795 // m_xmlHandlerStatistics->m_id = NULL;
796 // m_xmlHandlerStatistics->m_id = new QUuid(m_xmlHandlerCharacters);
797  }
798  if (localName == "sum") {
799  m_xmlHandlerStatistics->m_sum = toDouble(m_xmlHandlerCharacters);
800  }
801  if (localName == "sumSquares") {
802  m_xmlHandlerStatistics->m_sumsum = toDouble(m_xmlHandlerCharacters);
803  }
804  if (localName == "minimum") {
805  m_xmlHandlerStatistics->m_minimum = toDouble(m_xmlHandlerCharacters);
806  }
807  if (localName == "maximum") {
808  m_xmlHandlerStatistics->m_maximum = toDouble(m_xmlHandlerCharacters);
809  }
810  if (localName == "validMinimum") {
811  m_xmlHandlerStatistics->m_validMinimum = toDouble(m_xmlHandlerCharacters);
812  }
813  if (localName == "validMaximum") {
814  m_xmlHandlerStatistics->m_validMaximum = toDouble(m_xmlHandlerCharacters);
815  }
816  if (localName == "totalPixels") {
817  m_xmlHandlerStatistics->m_totalPixels = toBigInt(m_xmlHandlerCharacters);
818  }
819  if (localName == "validPixels") {
820  m_xmlHandlerStatistics->m_validPixels = toBigInt(m_xmlHandlerCharacters);
821  }
822  if (localName == "nullPixels") {
823  m_xmlHandlerStatistics->m_nullPixels = toBigInt(m_xmlHandlerCharacters);
824  }
825  if (localName == "lisPixels") {
826  m_xmlHandlerStatistics->m_lisPixels = toBigInt(m_xmlHandlerCharacters);
827  }
828  if (localName == "lrsPixels") {
829  m_xmlHandlerStatistics->m_lrsPixels = toBigInt(m_xmlHandlerCharacters);
830  }
831  if (localName == "hisPixels") {
832  m_xmlHandlerStatistics->m_hisPixels = toBigInt(m_xmlHandlerCharacters);
833  }
834  if (localName == "hrsPixels") {
835  m_xmlHandlerStatistics->m_hrsPixels = toBigInt(m_xmlHandlerCharacters);
836  }
837  if (localName == "underRangePixels") {
838  m_xmlHandlerStatistics->m_underRangePixels = toBigInt(m_xmlHandlerCharacters);
839  }
840  if (localName == "overRangePixels") {
841  m_xmlHandlerStatistics->m_overRangePixels = toBigInt(m_xmlHandlerCharacters);
842  }
843  if (localName == "removedData") {
844  m_xmlHandlerStatistics->m_removedData = toBool(m_xmlHandlerCharacters);
845  }
846  m_xmlHandlerCharacters = "";
847  }
848  return XmlStackedHandler::endElement(namespaceURI, localName, qName);
849  }
850 
851 
856  QDataStream &Statistics::write(QDataStream &stream) const {
857  stream.setByteOrder(QDataStream::LittleEndian);
858  stream << m_sum
859  << m_sumsum
860  << m_minimum
861  << m_maximum
862  << m_validMinimum
863  << m_validMaximum
864  << (qint64)m_totalPixels
865  << (qint64)m_validPixels
866  << (qint64)m_nullPixels
867  << (qint64)m_lrsPixels
868  << (qint64)m_lisPixels
869  << (qint64)m_hrsPixels
870  << (qint64)m_hisPixels
871  << (qint64)m_underRangePixels
872  << (qint64)m_overRangePixels
873  << (qint32)m_removedData;
874  return stream;
875 // stream << m_id->toString()
876  }
877 
878 
879  QDataStream &Statistics::read(QDataStream &stream) {
880 
881 // QString id;
882  qint64 totalPixels, validPixels, nullPixels, lrsPixels, lisPixels,
883  hrsPixels, hisPixels, underRangePixels, overRangePixels;
884  qint32 removedData;
885 
886  stream.setByteOrder(QDataStream::LittleEndian);
887 // stream >> id
888  stream >> m_sum
889  >> m_sumsum
890  >> m_minimum
891  >> m_maximum
892  >> m_validMinimum
893  >> m_validMaximum
894  >> totalPixels
895  >> validPixels
896  >> nullPixels
897  >> lrsPixels
898  >> lisPixels
899  >> hrsPixels
900  >> hisPixels
901  >> underRangePixels
902  >> overRangePixels
903  >> removedData;
904 
905 // delete m_id;
906 // m_id = NULL;
907 // m_id = new QUuid(id);
908 
909  m_totalPixels = (BigInt)totalPixels;
910  m_validPixels = (BigInt)validPixels;
911  m_nullPixels = (BigInt)nullPixels;
912  m_lrsPixels = (BigInt)lrsPixels;
913  m_lisPixels = (BigInt)lisPixels;
914  m_hrsPixels = (BigInt)hrsPixels;
915  m_hisPixels = (BigInt)hisPixels;
916  m_underRangePixels = (BigInt)underRangePixels;
917  m_overRangePixels = (BigInt)overRangePixels;
918  m_removedData = (bool)removedData;
919 
920  return stream;
921  }
922 
923 
924  QDataStream &operator<<(QDataStream &stream, const Statistics &statistics) {
925  return statistics.write(stream);
926  }
927 
928 
929  QDataStream &operator>>(QDataStream &stream, Statistics &statistics) {
930  return statistics.read(stream);
931  }
932 
933 } // end namespace isis
Isis::Statistics::SumSquare
double SumSquare() const
Returns the sum of all the squared data.
Definition: Statistics.cpp:351
Isis::Statistics::NullPixels
BigInt NullPixels() const
Returns the total number of NULL pixels encountered.
Definition: Statistics.cpp:465
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::Statistics::AddData
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:141
Isis::Statistics::Sum
double Sum() const
Returns the sum of all the data.
Definition: Statistics.cpp:341
Isis::operator<<
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition: Hillshade.cpp:314
Isis::Statistics::TotalPixels
BigInt TotalPixels() const
Returns the total number of pixels processed (valid and invalid).
Definition: Statistics.cpp:420
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Project.h
Isis::Statistics::m_validMinimum
double m_validMinimum
Minimum valid pixel value.
Definition: Statistics.h:195
Isis::Statistics::m_lrsPixels
BigInt m_lrsPixels
Count of low instrument saturation pixels processed.
Definition: Statistics.h:200
Isis::Statistics::m_hisPixels
BigInt m_hisPixels
Count of high instrument representation pixels processed.
Definition: Statistics.h:203
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
Isis::Statistics::m_underRangePixels
BigInt m_underRangePixels
Count of pixels less than the valid range.
Definition: Statistics.h:204
Isis::IsNullPixel
bool IsNullPixel(const double d)
Returns if the input pixel is null.
Definition: SpecialPixel.h:235
Isis::Statistics::fromPvl
void fromPvl(const PvlGroup &inStats)
Unserializes a Statistics object from a pvl group.
Definition: Statistics.cpp:667
Isis::Statistics::Maximum
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
Definition: Statistics.cpp:403
Isis::Statistics::Reset
void Reset()
Reset all accumulators and counters to zero.
Definition: Statistics.cpp:113
Isis::Statistics::HrsPixels
BigInt HrsPixels() const
Returns the total number of high representation saturation (HRS) pixels encountered.
Definition: Statistics.cpp:509
Isis::IsHrsPixel
bool IsHrsPixel(const double d)
Returns if the input pixel is high representation saturation.
Definition: SpecialPixel.h:271
Isis::Statistics::ValidPixels
BigInt ValidPixels() const
Returns the total number of valid pixels processed.
Definition: Statistics.cpp:433
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::Statistics::OverRangePixels
BigInt OverRangePixels() const
Returns the total number of pixels over the valid range encountered.
Definition: Statistics.cpp:444
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::Statistics::m_sum
double m_sum
The sum accumulator, i.e. the sum of added data values.
Definition: Statistics.h:190
Isis::Statistics::m_totalPixels
BigInt m_totalPixels
Count of total pixels processed.
Definition: Statistics.h:197
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::Statistics::RemoveData
void RemoveData(const double *data, const unsigned int count)
Remove an array of doubles from the accumulators and counters.
Definition: Statistics.cpp:206
Isis::Statistics::HisPixels
BigInt HisPixels() const
Returns the total number of high instrument saturation (HIS) pixels encountered.
Definition: Statistics.cpp:498
Isis::Statistics::Variance
double Variance() const
Computes and returns the variance.
Definition: Statistics.cpp:328
Isis::Statistics::UnderRangePixels
BigInt UnderRangePixels() const
Returns the total number of pixels under the valid range encountered.
Definition: Statistics.cpp:455
Isis::Statistics::LisPixels
BigInt LisPixels() const
Returns the total number of low instrument saturation (LIS) pixels encountered.
Definition: Statistics.cpp:476
Isis::Statistics::ChebyshevMaximum
double ChebyshevMaximum(const double percent=99.5) const
This method returns a maximum such that X percent of the data will fall with K standard deviations of...
Definition: Statistics.cpp:572
Isis::Statistics::Rms
double Rms() const
Computes and returns the rms.
Definition: Statistics.cpp:365
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::toBigInt
BigInt toBigInt(const QString &string)
Global function to convert from a string to a "big" integer.
Definition: IString.cpp:115
Isis::Statistics::m_hrsPixels
BigInt m_hrsPixels
Count of high instrument saturation pixels processed.
Definition: Statistics.h:202
Isis::Statistics::StandardDeviation
double StandardDeviation() const
Computes and returns the standard deviation.
Definition: Statistics.cpp:312
Isis::Statistics::Minimum
double Minimum() const
Returns the absolute minimum double found in all data passed through the AddData method.
Definition: Statistics.cpp:382
Isis::Statistics::m_sumsum
double m_sumsum
The sum-squared accumulator, i.e.
Definition: Statistics.h:191
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
Isis::Statistics::BestMaximum
double BestMaximum(const double percent=99.5) const
This method returns the better of the absolute maximum or the Chebyshev maximum.
Definition: Statistics.cpp:625
Isis::Statistics::m_minimum
double m_minimum
Minimum double value encountered.
Definition: Statistics.h:193
Isis::Statistics::ZScore
double ZScore(const double value) const
This method returns the better of the z-score of the given value.
Definition: Statistics.cpp:649
Isis::Statistics::m_lisPixels
BigInt m_lisPixels
Count of low representation saturation pixels processed.
Definition: Statistics.h:201
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Statistics::m_validMaximum
double m_validMaximum
Maximum valid pixel value.
Definition: Statistics.h:196
Isis::Statistics::m_maximum
double m_maximum
Maximum double value encountered.
Definition: Statistics.h:194
Isis::IsLisPixel
bool IsLisPixel(const double d)
Returns if the input pixel is low instrument saturation.
Definition: SpecialPixel.h:295
Isis::Statistics::OutOfRangePixels
BigInt OutOfRangePixels() const
Returns the total number of pixels outside of the valid range encountered.
Definition: Statistics.cpp:520
Isis::Statistics::toPvl
PvlGroup toPvl(QString name="Statistics") const
Serialize statistics as a pvl group.
Definition: Statistics.cpp:695
Isis::IsLrsPixel
bool IsLrsPixel(const double d)
Returns if the input pixel is low representation saturation.
Definition: SpecialPixel.h:307
Isis::Statistics::Average
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:300
Isis::IsHisPixel
bool IsHisPixel(const double d)
Returns if the input pixel is high instrument saturation.
Definition: SpecialPixel.h:283
Isis::toDouble
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis::Statistics::BestMinimum
double BestMinimum(const double percent=99.5) const
This method returns the better of the absolute minimum or the Chebyshev minimum.
Definition: Statistics.cpp:598
Isis::Statistics::m_validPixels
BigInt m_validPixels
Count of valid pixels (non-special) processed.
Definition: Statistics.h:198
Isis::Statistics::Statistics
Statistics(QObject *parent=0)
Constructs an IsisStats object with accumulators and counters set to zero.
Definition: Statistics.cpp:28
Isis::toBool
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:38
Isis::Statistics::write
QDataStream & write(QDataStream &stream) const
Order saved must match the offsets in the static compoundH5DataType() method.
Definition: Statistics.cpp:856
Isis::Statistics::ChebyshevMinimum
double ChebyshevMinimum(const double percent=99.5) const
This method returns a minimum such that X percent of the data will fall with K standard deviations of...
Definition: Statistics.cpp:545
Isis::Statistics::~Statistics
virtual ~Statistics()
Destroys the IsisStats object.
Definition: Statistics.cpp:77
Isis::Statistics::m_nullPixels
BigInt m_nullPixels
Count of null pixels processed.
Definition: Statistics.h:199
QObject
Isis::Statistics::LrsPixels
BigInt LrsPixels() const
Returns the total number of low representation saturation (LRS) pixels encountered.
Definition: Statistics.cpp:487
Isis::operator>>
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:447
Isis::Statistics::m_removedData
bool m_removedData
Indicates the RemoveData method was called which implies m_minimum and m_maximum are invalid.
Definition: Statistics.h:206
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Statistics::m_overRangePixels
BigInt m_overRangePixels
Count of pixels greater than the valid range.
Definition: Statistics.h:205