Isis Developer Reference
Histogram.h
Go to the documentation of this file.
1 #ifndef Histogram_h
2 #define Histogram_h
3 
9 #include "Cube.h"
10 #include "Constants.h"
11 #include "IException.h"
12 #include "Progress.h"
13 #include "SpecialPixel.h"
14 #include "Statistics.h"
15 
16 namespace Isis {
17  class ControlNet;
18  class ControlMeasure;
74  class Histogram : public Statistics {
75  public:
76  Histogram() = default;
77  Histogram(double minimum, double maximum,
78  int bins = 1024);
79  Histogram(Cube &cube, int statsBand, Progress *progress = NULL,
80  double startSample = 1.0, double startLine = 1.0,
81  double endSample = Null, double endLine = Null, int bins = 0,
82  bool addCubeData = false);
83 
84  //constuctors that use ControlNetworks to build histograms of ControlMeasure data
85  Histogram(ControlNet &net, double(ControlMeasure::*statFunc)() const, int bins);
86  Histogram(ControlNet &net, double(ControlMeasure::*statFunc)() const, double binWidth);
87 
88  ~Histogram();
89 
90  void SetBins(const int bins);
91 
92  void Reset();
93  virtual void AddData(const double *data, const unsigned int count);
94  virtual void AddData(const double data);
95  virtual void RemoveData(const double *data, const unsigned int count);
96 
97  double Median() const;
98  double Mode() const;
99  double Percent(const double percent) const;
100  double Skew() const;
101 
102  BigInt BinCount(const int index) const;
103  virtual void BinRange(const int index, double &low, double &high) const;
104  double BinMiddle(const int index) const;
105  double BinSize() const;
106  int Bins() const;
107  BigInt MaxBinCount() const;
108 
109  double BinRangeStart() const {
110  return p_binRangeStart;
111  }
112  double BinRangeEnd() const {
113  return p_binRangeEnd;
114  }
115  //void SetBinRange(double binStart, double binEnd);
116  void SetValidRange(const double minimum = Isis::ValidMinimum,
117  const double maximum = Isis::ValidMaximum);
118 
119  protected:
121  std::vector<BigInt> p_bins;
122 
123  private:
124  double p_binRangeStart, p_binRangeEnd;
125  void addMeasureDataFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const);
126  void rangesFromNet(ControlNet &net, double(ControlMeasure::*statFunc)() const);
127  };
128 };
129 
130 #endif
Isis::ValidMaximum
const double ValidMaximum
The maximum valid double value for Isis pixels.
Definition: SpecialPixel.h:122
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Cube.h
Isis::Histogram::Percent
double Percent(const double percent) const
Computes and returns the value at X percent of the histogram.
Definition: Histogram.cpp:351
Isis::Histogram::MaxBinCount
BigInt MaxBinCount() const
Returns the highest bin count.
Definition: Histogram.cpp:493
Isis::Average
Functor for reduce using average functionality.
Definition: Reduce.h:107
Isis::ControlPoint::GetMeasure
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Definition: ControlPoint.cpp:416
Histogram.h
Isis::Histogram::SetBins
void SetBins(const int bins)
Change the number of bins in the histogram and reset counters.
Definition: Histogram.cpp:219
Isis::Histogram::BinRangeStart
double BinRangeStart() const
Definition: Histogram.h:109
SpecialPixel.h
Isis::Histogram::BinSize
double BinSize() const
Returns the size of an individual bin.
Definition: Histogram.cpp:470
Isis::Histogram::Histogram
Histogram(Cube &cube, int statsBand, Progress *progress=NULL, double startSample=1.0, double startLine=1.0, double endSample=Null, double endLine=Null, int bins=0, bool addCubeData=false)
Isis::ControlPoint::GetNumMeasures
int GetNumMeasures() const
Definition: ControlPoint.cpp:1702
Isis::Histogram::RemoveData
virtual void RemoveData(const double *data, const unsigned int count)
Remove an array of doubles from the histogram counters.
Definition: Histogram.cpp:291
Isis::Histogram::Reset
void Reset()
Resets histogram counters to zero.
Definition: Histogram.cpp:210
Isis::Histogram::BinMiddle
double BinMiddle(const int index) const
Returns the value represented by a bin.
Definition: Histogram.cpp:449
LineManager.h
Isis::Histogram::Skew
double Skew() const
Computes and returns the skew.
Definition: Histogram.cpp:384
Isis::Statistics::SetValidRange
void SetValidRange(const double minimum=Isis::ValidMinimum, const double maximum=Isis::ValidMaximum)
Definition: Statistics.cpp:255
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
Isis::ControlMeasure::IsIgnored
bool IsIgnored() const
Definition: ControlMeasure.cpp:630
Isis::Histogram::BinRange
virtual void BinRange(const int index, double &low, double &high) const
Returns the left edge and right edge values of a bin.
Definition: Histogram.cpp:427
Isis::Histogram::BinCount
BigInt BinCount(const int index) const
Returns the count at a bin position in the histogram.
Definition: Histogram.cpp:403
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
ControlNet.h
Isis::ControlNet::GetNumPoints
int GetNumPoints() const
Return the number of control points in the network.
Definition: ControlNet.cpp:1465
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Histogram::AddData
virtual void AddData(const double *data, const unsigned int count)
Add an array of doubles to the histogram counters.
Definition: Histogram.cpp:232
Isis::Histogram::SetValidRange
void SetValidRange(const double minimum=Isis::ValidMinimum, const double maximum=Isis::ValidMaximum)
Changes the range of the bins.
Definition: Histogram.cpp:192
Isis::Histogram::p_bins
std::vector< BigInt > p_bins
The array of counts.
Definition: Histogram.h:121
Isis::Histogram::Mode
double Mode() const
Returns the mode.
Definition: Histogram.cpp:328
Isis::NULL8
const double NULL8
Definition: SpecialPixel.h:94
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
ControlPoint.h
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::Histogram::Bins
int Bins() const
Returns the number of bins in the histogram.
Definition: Histogram.cpp:483
Statistics.h
IException.h
Isis::ValidMinimum
const double ValidMinimum
The minimum valid double value for Isis pixels.
Definition: SpecialPixel.h:87
Isis::Histogram::Median
double Median() const
Returns the median.
Definition: Histogram.cpp:319
std
Namespace for the standard library.
Isis::Histogram
Container of a cube histogram.
Definition: Histogram.h:74
Isis::IsValidPixel
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
Definition: SpecialPixel.h:223
Isis::Histogram::Histogram
Histogram()=default
Isis::ControlPoint::IsIgnored
bool IsIgnored() const
Definition: ControlPoint.cpp:1311
Isis::Histogram::BinRangeEnd
double BinRangeEnd() const
Definition: Histogram.h:112
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Constants.h
Isis::Histogram::~Histogram
~Histogram()
Destructs a histogram object.
Definition: Histogram.cpp:175
Isis::Message::ArraySubscriptNotInRange
QString ArraySubscriptNotInRange(int index)
This error should be used when an Isis object or application is checking array bounds and the legal r...
Definition: ArraySubscriptNotInRange.cpp:31
Progress.h
Isis::ControlNet::GetPoint
const ControlPoint * GetPoint(QString pointId) const
Definition: ControlNet.cpp:1815
ControlMeasure.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Message.h
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175