Isis 3 Developer Reference
Histogram.h
Go to the documentation of this file.
1 
23 #ifndef Histogram_h
24 #define Histogram_h
25 
26 #include "Cube.h"
27 #include "Constants.h"
28 #include "IException.h"
29 #include "Progress.h"
30 #include "SpecialPixel.h"
31 #include "Statistics.h"
32 
33 namespace Isis {
34  class ControlNet;
35  class ControlMeasure;
86  class Histogram : public Statistics {
87  public:
88  Histogram(double minimum, double maximum,
89  int bins = 1024);
90  Histogram(Cube &cube, int statsBand, Progress *progress = NULL,
91  double startSample = 1.0, double startLine = 1.0,
92  double endSample = Null, double endLine = Null, int bins = 0,
93  bool addCubeData = false);
94 
95  //constuctors that use ControlNetworks to build histograms of ControlMeasure data
96  Histogram(ControlNet &net, double(ControlMeasure::*statFunc)() const, int bins);
97  Histogram(ControlNet &net, double(ControlMeasure::*statFunc)() const, double binWidth);
98 
99  ~Histogram();
100 
101  void SetBins(const int bins);
102 
103  void Reset();
104  void AddData(const double *data, const unsigned int count);
105  void AddData(const double data);
106  void RemoveData(const double *data, const unsigned int count);
107 
108  double Median() const;
109  double Mode() const;
110  double Percent(const double percent) const;
111  double Skew() const;
112 
113  BigInt BinCount(const int index) const;
114  void BinRange(const int index, double &low, double &high) const;
115  double BinMiddle(const int index) const;
116  double BinSize() const;
117  int Bins() const;
118  BigInt MaxBinCount() const;
119 
120  double BinRangeStart() const {
121  return p_binRangeStart;
122  }
123  double BinRangeEnd() const {
124  return p_binRangeEnd;
125  }
126  //void SetBinRange(double binStart, double binEnd);
127  void SetValidRange(const double minimum = Isis::ValidMinimum,
128  const double maximum = Isis::ValidMaximum);
129 
130  private:
131  void InitializeFromCube(Cube &cube, int statsBand, Progress *progress,
132  int nbins = 0, double startSample = Null, double startLine = Null,
133  double endSample = Null, double endLine = Null);
134 
135  void addMeasureDataFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const);
136  void rangesFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const);
137 
139  std::vector<BigInt> p_bins;
140  double p_binRangeStart, p_binRangeEnd;
141  };
142 };
143 
144 #endif
long long int BigInt
Big int.
Definition: Constants.h:65
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the histogram counters.
Definition: Histogram.cpp:453
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:110
const double ValidMinimum
The minimum valid double value for Isis pixels.
Definition: SpecialPixel.h:102
double BinRangeStart() const
Definition: Histogram.h:120
BigInt BinCount(const int index) const
Returns the count at a bin position in the histogram.
Definition: Histogram.cpp:624
double BinMiddle(const int index) const
Returns the value represented by a bin.
Definition: Histogram.cpp:670
~Histogram()
Destructs a histogram object.
Definition: Histogram.cpp:396
double Skew() const
Computes and returns the skew.
Definition: Histogram.cpp:605
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
void SetValidRange(const double minimum=Isis::ValidMinimum, const double maximum=Isis::ValidMaximum)
Changes the range of the bins.
Definition: Histogram.cpp:413
Program progress reporter.
Definition: Progress.h:58
double Mode() const
Returns the mode.
Definition: Histogram.cpp:549
a control network
Definition: ControlNet.h:271
Container of a cube histogram.
Definition: Histogram.h:86
void Reset()
Resets histogram counters to zero.
Definition: Histogram.cpp:431
double BinRangeEnd() const
Definition: Histogram.h:123
double Percent(const double percent) const
Computes and returns the value at X percent of the histogram.
Definition: Histogram.cpp:572
Histogram(double minimum, double maximum, int bins=1024)
Constructs a histogram object.
Definition: Histogram.cpp:50
BigInt MaxBinCount() const
Returns the highest bin count.
Definition: Histogram.cpp:714
double BinSize() const
Returns the size of an individual bin.
Definition: Histogram.cpp:691
void RemoveData(const double *data, const unsigned int count)
Remove an array of doubles from the histogram counters.
Definition: Histogram.cpp:512
const double ValidMaximum
The maximum valid double value for Isis pixels.
Definition: SpecialPixel.h:137
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
Definition: ControlMeasure.h:189
void SetBins(const int bins)
Change the number of bins in the histogram and reset counters.
Definition: Histogram.cpp:440
int Bins() const
Returns the number of bins in the histogram.
Definition: Histogram.cpp:704
double Median() const
Returns the median.
Definition: Histogram.cpp:540
void BinRange(const int index, double &low, double &high) const
Returns the left edge and right edge values of a bin.
Definition: Histogram.cpp:648
IO Handler for Isis Cubes.
Definition: Cube.h:170