Isis Developer Reference
ScatterPlotData.h
Go to the documentation of this file.
1 #ifndef ScatterPlotData_h
2 #define ScatterPlotData_h
3 
4 #include <qwt_raster_data.h>
5 
6 #include <QScopedPointer>
7 #include <QVector>
8 
9 #include "Stretch.h"
10 
11 template <typename A, typename B> struct QPair;
12 template <typename T> class QVector;
13 
14 class QwtInterval;
15 
16 namespace Isis {
17  class Cube;
18 
28  class ScatterPlotData : public QwtRasterData {
29  public:
30  ScatterPlotData(Cube *xCube, int xCubeBand, int xBinCount,
31  Cube *yCube, int yCubeBand, int yBinCount,
32  QwtInterval sampleRange, QwtInterval lineRange);
33  ScatterPlotData(const ScatterPlotData &other);
34 
36  virtual QwtRasterData *copy() const;
37  virtual double value(double x, double y) const;
38 
39  double xCubeMin() const;
40  double xCubeMax() const;
41  double yCubeMin() const;
42  double yCubeMax() const;
43 
44  void swap(ScatterPlotData &other);
45 
46  QPair<double, double> binXY(int binIndex) const;
47  int binCount(int binIndex) const;
48  int numberOfBins() const;
49 
51 
52  void alarm(double x, double y);
53  void clearAlarms();
54 
55  QRectF pixelHint(const QRectF &area) const;
56 
58 
59  private:
60  int binCount(int xIndex, int yIndex) const;
61  int binIndex(int xIndex, int yIndex) const;
62  int binIndex(double x, double y) const;
63  QPair<int, int> binXYIndices(int binIndex) const;
64  QPair<int, int> binXYIndices(double x, double y) const;
65 
66  QScopedPointer<Stretch> m_xDnToBinStretch;
67  QScopedPointer<Stretch> m_yDnToBinStretch;
68 
73  QScopedPointer< QVector< QVector<int> > > m_counts;
74 
76  int m_maxCount;
77 
81  QScopedPointer< QMap<int, bool> > m_alarmedBins;
82 
84  double m_xCubeMin;
86  double m_xCubeMax;
88  double m_yCubeMin;
90  double m_yCubeMax;
91  };
92 };
93 
94 #endif
Isis::Brick::SetBasePosition
void SetBasePosition(const int start_sample, const int start_line, const int start_band)
This method is used to set the base position of the shape buffer.
Definition: Brick.h:120
Stretch.h
QwtRasterData
Isis::Cube::read
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
SpecialPixel.h
Isis::Stretch
Pixel value mapper.
Definition: Stretch.h:58
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::ScatterPlotData::xCubeMax
double xCubeMax() const
Return the max DN value for the y-axis cube's data range.
Definition: ScatterPlotData.cpp:182
Isis::ScatterPlotData::clearAlarms
void clearAlarms()
Forget all alarmed bins (viewport->plot).
Definition: ScatterPlotData.cpp:333
Isis::Brick
Buffer for containing a three dimensional section of an image.
Definition: Brick.h:45
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
Isis::ScatterPlotData::ScatterPlotData
ScatterPlotData(Cube *xCube, int xCubeBand, int xBinCount, Cube *yCube, int yCubeBand, int yBinCount, QwtInterval sampleRange, QwtInterval lineRange)
ScatterPlotDataConstructor.
Definition: ScatterPlotData.cpp:26
Isis::ScatterPlotData::swap
void swap(ScatterPlotData &other)
This is part of the copy-and-swap paradigm.
Definition: ScatterPlotData.cpp:212
Isis::ScatterPlotData::operator=
ScatterPlotData & operator=(const ScatterPlotData &other)
Take the data from other and copy it into this.
Definition: ScatterPlotData.cpp:365
Isis::ScatterPlotData::binXY
QPair< double, double > binXY(int binIndex) const
Get the center X/Y Dn values for the bin at index.
Definition: ScatterPlotData.cpp:232
Isis::ScatterPlotData::copy
virtual QwtRasterData * copy() const
Returns a copy of the ScatterPlotData object.
Definition: ScatterPlotData.cpp:138
Isis::ScatterPlotData::numberOfBins
int numberOfBins() const
Get the total number of bins (bin count in x * bin count in y).
Definition: ScatterPlotData.cpp:280
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::ScatterPlotData::pixelHint
QRectF pixelHint(const QRectF &area) const
This is a hint given to qwt for how to render a pixel in the spectrogram.
Definition: ScatterPlotData.cpp:344
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::ScatterPlotData::yCubeMin
double yCubeMin() const
Return the min DN value for the y-axis cube's data range.
Definition: ScatterPlotData.cpp:192
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::ScatterPlotData
This is the QwtRasterData for a scatter plot.
Definition: ScatterPlotData.h:28
ScatterPlotData.h
Isis::ImageHistogram
Container of a cube histogram.
Definition: ImageHistogram.h:40
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
Isis::ScatterPlotData::xCubeMin
double xCubeMin() const
Return the min DN value for the x-axis cube's data range.
Definition: ScatterPlotData.cpp:172
Isis::ScatterPlotData::discreteXValues
QVector< double > discreteXValues() const
Get a list of all of the x-bin center values for this scatter plot.
Definition: ScatterPlotData.cpp:297
Brick.h
Isis::ScatterPlotData::value
virtual double value(double x, double y) const
This gets called every time the scatter plot is re-drawn.
Definition: ScatterPlotData.cpp:152
Isis::ScatterPlotData::yCubeMax
double yCubeMax() const
Return the max DN value for the y-axis cube's data range.
Definition: ScatterPlotData.cpp:202
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::Cube::pixelType
PixelType pixelType() const
Definition: Cube.cpp:1758
Isis::ScatterPlotData::binCount
int binCount(int binIndex) const
Get the count (number of values) which fall into the bin at index.
Definition: ScatterPlotData.cpp:269
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
Isis::ScatterPlotData::~ScatterPlotData
~ScatterPlotData()
Destructor.
Definition: ScatterPlotData.cpp:129
QMap
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:22
Isis::Buffer::size
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:97
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
IsisDebug.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ScatterPlotData::alarm
void alarm(double x, double y)
Alarm the bin (highlight it) at the given x/y DN value.
Definition: ScatterPlotData.cpp:323