Isis 3 Programmer Reference
StatisticsTool.h
1 #ifndef StatisticsTool_h
2 #define StatisticsTool_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QAction>
13 #include <QPixmap>
14 
15 // Only includes for Parents of classes defined in this file are allowed here!
16 #include "Tool.h"
17 #include <QWidget>
18 
19 
20 // FIXME: remove these includes
21 #include "Stretch.h"
22 #include <vector>
23 
24 class QScrollArea;
25 class QLabel;
26 class QLineEdit;
27 class QCheckBox;
28 class QGroupBox;
29 
30 namespace Isis {
48  class VisualDisplay : public QWidget {
49  Q_OBJECT
50 
51  public:
52  VisualDisplay(QWidget *parent = 0);
53 
54  QSize sizeHint() const;
55 
56  void setSamples(int samps);
57  void setLines(int lines);
58 
59  void updateSize();
60 
61  void setPixelData(QVector<QVector<double> > data, int samp, int line);
62 
63  protected:
64  void paintPixmap();
65  void paintEvent(QPaintEvent *event);
66  void mouseMoveEvent(QMouseEvent *event);
67  void leaveEvent(QEvent *event);
68 
69  signals:
75  void setDn(const QString st);
81  void setSample(const QString st);
87  void setLine(const QString st);
88 
89  protected slots:
90  void setBoxSize(int size);
91  void showText(bool b);
92  void showPixels(bool b);
93  void showDeviation(bool b);
94 
95  private:
96  int p_boxSamps;
97  int p_boxLines;
98  int p_boxWidth;
102  int p_ulSamp;
103  int p_ulLine;
104  bool p_set;
105  bool p_showText;
108 
109  QPixmap p_pixmap;
113  };
114 
121  class StatisticsTool : public Tool {
122  Q_OBJECT
123 
124  public:
125  StatisticsTool(QWidget *parent);
126 
127  protected:
128  QAction *toolPadAction(ToolPad *toolpad);
129  QWidget *createToolBarWidget(QStackedWidget *parent);
130 
131  protected slots:
132  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
133  void hideDisplay(bool hide);
134  void resizeScrollbars();
135 
136  private:
137  void getStatistics(QPoint p);
138 
141  QScrollArea *p_visualScroll;
142  QGroupBox *p_visualBox;
144  QLabel *p_boxLabel;
145  QLabel *p_minLabel;
146  QLabel *p_maxLabel;
147  QLabel *p_avgLabel;
148  QLabel *p_stdevLabel;
149  QLabel *p_sampLabel;
150  QLabel *p_lineLabel;
151  QLabel *p_dnLabel;
152  QLineEdit *p_sampsEdit;
153  QLineEdit *p_linesEdit;
154 
157 
158  int p_ulSamp;
159  int p_ulLine;
160 
161  bool p_set;
162 
163  private slots:
164  void changeBoxSamples();
165  void changeBoxLines();
166  };
167 };
168 
169 #endif
Isis::VisualDisplay::p_pixelData
QVector< QVector< double > > p_pixelData
Stored pixel values.
Definition: StatisticsTool.h:112
QWidget
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::StatisticsTool::p_maxLabel
QLabel * p_maxLabel
Maximum label.
Definition: StatisticsTool.h:146
Isis::StatisticsTool::p_sampsEdit
QLineEdit * p_sampsEdit
Sample size line edit.
Definition: StatisticsTool.h:152
Isis::VisualDisplay::p_ulSamp
int p_ulSamp
Upper left sample of region captured.
Definition: StatisticsTool.h:102
Isis::StatisticsTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Attaches this tool to the toolbar.
Definition: StatisticsTool.cpp:201
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::Stretch
Pixel value mapper.
Definition: Stretch.h:58
Isis::VisualDisplay::p_stretch
Stretch p_stretch
Stretch used to display pixels.
Definition: StatisticsTool.h:110
Isis::VisualDisplay::p_ulLine
int p_ulLine
Upper left line of region captured.
Definition: StatisticsTool.h:103
Isis::VisualDisplay
Tool to visualize statistics in an n * m box.
Definition: StatisticsTool.h:48
Isis::StatisticsTool::changeBoxLines
void changeBoxLines()
Change the box line size.
Definition: StatisticsTool.cpp:390
Isis::VisualDisplay::VisualDisplay
VisualDisplay(QWidget *parent=0)
Constructor for visual display.
Definition: StatisticsTool.cpp:422
Isis::StatisticsTool::p_avgLabel
QLabel * p_avgLabel
Average label.
Definition: StatisticsTool.h:147
Isis::VisualDisplay::setLine
void setLine(const QString st)
Signal to set the Line label to st.
Isis::StatisticsTool
Definition: StatisticsTool.h:121
Isis::VisualDisplay::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event)
Called when the mouse moves over this widget.
Definition: StatisticsTool.cpp:717
Isis::VisualDisplay::showDeviation
void showDeviation(bool b)
Show/Hide deviation.
Definition: StatisticsTool.cpp:562
Isis::VisualDisplay::p_set
bool p_set
Boolean to see if data is set.
Definition: StatisticsTool.h:104
Isis::VisualDisplay::setLines
void setLines(int lines)
Set box line size.
Definition: StatisticsTool.cpp:479
Isis::StatisticsTool::p_visualBox
QGroupBox * p_visualBox
Visual group box to hold visual display.
Definition: StatisticsTool.h:142
Isis::StatisticsTool::p_visualDisplay
VisualDisplay * p_visualDisplay
Visual display.
Definition: StatisticsTool.h:143
Isis::VisualDisplay::setSample
void setSample(const QString st)
Signal to set the Sample label to st.
Isis::StatisticsTool::p_dialog
QDialog * p_dialog
Dialog to show pixel data and statistics.
Definition: StatisticsTool.h:140
Isis::VisualDisplay::setPixelData
void setPixelData(QVector< QVector< double > > data, int samp, int line)
Set pixel data and upper left sample/line.
Definition: StatisticsTool.cpp:580
Isis::StatisticsTool::p_dnLabel
QLabel * p_dnLabel
DN label.
Definition: StatisticsTool.h:151
Isis::StatisticsTool::getStatistics
void getStatistics(QPoint p)
Retrieve the statistics based on the box size and point on the cube.
Definition: StatisticsTool.cpp:293
Isis::VisualDisplay::leaveEvent
void leaveEvent(QEvent *event)
Mouse left widget, update labels.
Definition: StatisticsTool.cpp:745
Isis::VisualDisplay::p_showPixels
bool p_showPixels
Display pixels?
Definition: StatisticsTool.h:106
Isis::StatisticsTool::hideDisplay
void hideDisplay(bool hide)
Hide/Show the visual display.
Definition: StatisticsTool.cpp:266
Isis::VisualDisplay::p_showText
bool p_showText
Display text?
Definition: StatisticsTool.h:105
Isis::VisualDisplay::p_boxWidth
int p_boxWidth
Box width in pixels.
Definition: StatisticsTool.h:98
Isis::StatisticsTool::p_visualScroll
QScrollArea * p_visualScroll
Scroll area to house visual display.
Definition: StatisticsTool.h:141
Isis::VisualDisplay::setDn
void setDn(const QString st)
Signal to set the DN label to st.
Isis::StatisticsTool::p_boxSamps
int p_boxSamps
Sample size for box.
Definition: StatisticsTool.h:155
Isis::StatisticsTool::p_sampLabel
QLabel * p_sampLabel
Sample label.
Definition: StatisticsTool.h:149
Isis::VisualDisplay::updateSize
void updateSize()
Update the size of the box.
Definition: StatisticsTool.cpp:505
Isis::StatisticsTool::p_ulLine
int p_ulLine
Upper left line of region.
Definition: StatisticsTool.h:159
Isis::VisualDisplay::sizeHint
QSize sizeHint() const
Size hint for this widget.
Definition: StatisticsTool.cpp:456
Isis::StatisticsTool::p_lineLabel
QLabel * p_lineLabel
Line label.
Definition: StatisticsTool.h:150
Isis::ToolPad
Definition: ToolPad.h:14
Isis::VisualDisplay::setSamples
void setSamples(int samps)
Set box sample size.
Definition: StatisticsTool.cpp:465
Isis::StatisticsTool::p_linesEdit
QLineEdit * p_linesEdit
Line size line edit.
Definition: StatisticsTool.h:153
Isis::StatisticsTool::p_boxLines
int p_boxLines
Line size for box.
Definition: StatisticsTool.h:156
Isis::VisualDisplay::p_boxSamps
int p_boxSamps
Sample size for box.
Definition: StatisticsTool.h:96
Isis::StatisticsTool::resizeScrollbars
void resizeScrollbars()
Resize the scroll bars and center the point clicked.
Definition: StatisticsTool.cpp:410
Isis::StatisticsTool::StatisticsTool
StatisticsTool(QWidget *parent)
Constructor, creates and sets up widgets for this tool.
Definition: StatisticsTool.cpp:32
Isis::VisualDisplay::p_oldHeight
int p_oldHeight
Previous box height in pixels.
Definition: StatisticsTool.h:101
Isis::StatisticsTool::mouseButtonRelease
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Called when a mouse button is released.
Definition: StatisticsTool.cpp:255
Isis::StatisticsTool::p_boxLabel
QLabel * p_boxLabel
Box label.
Definition: StatisticsTool.h:144
Isis::VisualDisplay::showText
void showText(bool b)
Show/Hide text.
Definition: StatisticsTool.cpp:529
Isis::StatisticsTool::p_action
QAction * p_action
Action associated with this tool.
Definition: StatisticsTool.h:139
Isis::StatisticsTool::p_minLabel
QLabel * p_minLabel
Minimum label.
Definition: StatisticsTool.h:145
Isis::VisualDisplay::p_boxLines
int p_boxLines
Line size for box.
Definition: StatisticsTool.h:97
QDialog
Isis::StatisticsTool::changeBoxSamples
void changeBoxSamples()
Change the box sample size.
Definition: StatisticsTool.cpp:370
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
Isis::VisualDisplay::showPixels
void showPixels(bool b)
Show/Hide pixels.
Definition: StatisticsTool.cpp:546
Isis::StatisticsTool::p_stdevLabel
QLabel * p_stdevLabel
Std Dev label.
Definition: StatisticsTool.h:148
Isis::VisualDisplay::p_oldWidth
int p_oldWidth
Previous box width in pixels.
Definition: StatisticsTool.h:100
QAction
Isis::VisualDisplay::p_showDeviation
bool p_showDeviation
Display deviation?
Definition: StatisticsTool.h:107
Isis::StatisticsTool::p_set
bool p_set
Boolean to see if data is set.
Definition: StatisticsTool.h:161
Isis::VisualDisplay::p_stats
Statistics p_stats
Stats used for calculating stretch and deviation.
Definition: StatisticsTool.h:111
Isis::VisualDisplay::p_boxHeight
int p_boxHeight
Box height in pixels.
Definition: StatisticsTool.h:99
Isis::VisualDisplay::paintEvent
void paintEvent(QPaintEvent *event)
Paint pixmap to the widget.
Definition: StatisticsTool.cpp:702
Isis::StatisticsTool::p_ulSamp
int p_ulSamp
Upper left sample of region.
Definition: StatisticsTool.h:158
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::VisualDisplay::setBoxSize
void setBoxSize(int size)
Set box size in pixels.
Definition: StatisticsTool.cpp:493
Isis::StatisticsTool::toolPadAction
QAction * toolPadAction(ToolPad *toolpad)
Attaches this tool to the toolpad.
Definition: StatisticsTool.cpp:182
Isis::VisualDisplay::paintPixmap
void paintPixmap()
Paint the pixmap.
Definition: StatisticsTool.cpp:624
Isis::VisualDisplay::p_pixmap
QPixmap p_pixmap
Pixmap used for drawing.
Definition: StatisticsTool.h:109