Isis 3.0 Programmer Reference
Back | Home
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;
78  class Histogram : public Statistics {
79  public:
80  Histogram(double minimum, double maximum,
81  int bins = 1024);
82  Histogram(Cube &cube, int statsBand, Progress *progress = NULL,
83  double startSample = 1.0, double startLine = 1.0,
84  double endSample = Null, double endLine = Null, int bins = 0,
85  bool addCubeData = false);
86 
87  //constuctors that use ControlNetworks to build histograms of ControlMeasure data
88  Histogram(ControlNet &net, double(ControlMeasure::*statFunc)() const, int bins);
89  Histogram(ControlNet &net, double(ControlMeasure::*statFunc)() const, double binWidth);
90 
91  ~Histogram();
92 
93  void SetBins(const int bins);
94 
95  void Reset();
96  void AddData(const double *data, const unsigned int count);
97  void AddData(const double data);
98  void RemoveData(const double *data, const unsigned int count);
99 
100  double Median() const;
101  double Mode() const;
102  double Percent(const double percent) const;
103  double Skew() const;
104 
105  BigInt BinCount(const int index) const;
106  void BinRange(const int index, double &low, double &high) const;
107  double BinMiddle(const int index) const;
108  double BinSize() const;
109  int Bins() const;
110  BigInt MaxBinCount() const;
111 
112  double BinRangeStart() const {
113  return p_binRangeStart;
114  }
115  double BinRangeEnd() const {
116  return p_binRangeEnd;
117  }
118  //void SetBinRange(double binStart, double binEnd);
119  void SetValidRange(const double minimum = Isis::ValidMinimum,
120  const double maximum = Isis::ValidMaximum);
121 
122  private:
123  void InitializeFromCube(Cube &cube, int statsBand, Progress *progress,
124  int nbins = 0, double startSample = Null, double startLine = Null,
125  double endSample = Null, double endLine = Null);
126 
127  void addMeasureDataFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const);
128  void rangesFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const);
129 
131  std::vector<BigInt> p_bins;
132  double p_binRangeStart, p_binRangeEnd;
133  };
134 };
135 
136 #endif
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the histogram counters.
Definition: Histogram.cpp:448
double Skew() const
Computes and returns the skew.
Definition: Histogram.cpp:600
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:109
void BinRange(const int index, double &low, double &high) const
Returns the left edge and right edge values of a bin.
Definition: Histogram.cpp:643
const double ValidMinimum
The minimum valid double value for Isis pixels.
Definition: SpecialPixel.h:101
double Percent(const double percent) const
Computes and returns the value at X percent of the histogram.
Definition: Histogram.cpp:567
int Bins() const
Returns the number of bins in the histogram.
Definition: Histogram.cpp:699
~Histogram()
Destructs a histogram object.
Definition: Histogram.cpp:391
BigInt BinCount(const int index) const
Returns the count at a bin position in the histogram.
Definition: Histogram.cpp:619
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:109
void SetValidRange(const double minimum=Isis::ValidMinimum, const double maximum=Isis::ValidMaximum)
Changes the range of the bins.
Definition: Histogram.cpp:408
Program progress reporter.
Definition: Progress.h:58
a control network
Definition: ControlNet.h:207
Container of a cube histogram.
Definition: Histogram.h:78
void Reset()
Resets histogram counters to zero.
Definition: Histogram.cpp:426
Histogram(double minimum, double maximum, int bins=1024)
Constructs a histogram object.
Definition: Histogram.cpp:49
std::vector< BigInt > p_bins
The array of counts.
Definition: Histogram.h:131
double Mode() const
Returns the mode.
Definition: Histogram.cpp:544
double BinMiddle(const int index) const
Returns the value represented by a bin.
Definition: Histogram.cpp:665
void RemoveData(const double *data, const unsigned int count)
Remove an array of doubles from the histogram counters.
Definition: Histogram.cpp:507
const double ValidMaximum
The maximum valid double value for Isis pixels.
Definition: SpecialPixel.h:136
void addMeasureDataFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const)
Iterates through all the measures in a network adding them to the histogram.
Definition: Histogram.cpp:201
a control measurement
double BinSize() const
Returns the size of an individual bin.
Definition: Histogram.cpp:686
double Median() const
Returns the median.
Definition: Histogram.cpp:535
void SetBins(const int bins)
Change the number of bins in the histogram and reset counters.
Definition: Histogram.cpp:435
BigInt MaxBinCount() const
Returns the highest bin count.
Definition: Histogram.cpp:709
void rangesFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const)
Iterates through all the measures in a network in order to find the domain of the data...
Definition: Histogram.cpp:232
IO Handler for Isis Cubes.
Definition: Cube.h:158

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:19:39