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
24class QScrollArea;
25class QLabel;
26class QLineEdit;
27class QCheckBox;
28class QGroupBox;
29
30namespace 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:
104 bool p_set;
108
109 QPixmap p_pixmap;
112 QVector<QVector<double> > p_pixelData;
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
160
161 bool p_set;
162
163 private slots:
164 void changeBoxSamples();
165 void changeBoxLines();
166 };
167};
168
169#endif
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
QLineEdit * p_sampsEdit
Sample size line edit.
QLabel * p_dnLabel
DN label.
QLineEdit * p_linesEdit
Line size line edit.
int p_ulLine
Upper left line of region.
int p_boxSamps
Sample size for box.
QLabel * p_stdevLabel
Std Dev label.
int p_ulSamp
Upper left sample of region.
StatisticsTool(QWidget *parent)
Constructor, creates and sets up widgets for this tool.
QLabel * p_lineLabel
Line label.
void resizeScrollbars()
Resize the scroll bars and center the point clicked.
VisualDisplay * p_visualDisplay
Visual display.
QScrollArea * p_visualScroll
Scroll area to house visual display.
QGroupBox * p_visualBox
Visual group box to hold visual display.
QAction * p_action
Action associated with this tool.
bool p_set
Boolean to see if data is set.
void changeBoxSamples()
Change the box sample size.
QAction * toolPadAction(ToolPad *toolpad)
Attaches this tool to the toolpad.
QLabel * p_sampLabel
Sample label.
QLabel * p_maxLabel
Maximum label.
QDialog * p_dialog
Dialog to show pixel data and statistics.
void changeBoxLines()
Change the box line size.
QLabel * p_boxLabel
Box label.
QWidget * createToolBarWidget(QStackedWidget *parent)
Attaches this tool to the toolbar.
void getStatistics(QPoint p)
Retrieve the statistics based on the box size and point on the cube.
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Called when a mouse button is released.
QLabel * p_avgLabel
Average label.
void hideDisplay(bool hide)
Hide/Show the visual display.
QLabel * p_minLabel
Minimum label.
int p_boxLines
Line size for box.
Pixel value mapper.
Definition Stretch.h:58
Base class for the Qisis tools.
Definition Tool.h:67
Tool to visualize statistics in an n * m box.
void showText(bool b)
Show/Hide text.
bool p_showPixels
Display pixels?
void updateSize()
Update the size of the box.
Statistics p_stats
Stats used for calculating stretch and deviation.
int p_boxSamps
Sample size for box.
void showDeviation(bool b)
Show/Hide deviation.
int p_boxLines
Line size for box.
bool p_set
Boolean to see if data is set.
int p_oldWidth
Previous box width in pixels.
QSize sizeHint() const
Size hint for this widget.
void setLines(int lines)
Set box line size.
void showPixels(bool b)
Show/Hide pixels.
void paintPixmap()
Paint the pixmap.
QVector< QVector< double > > p_pixelData
Stored pixel values.
Stretch p_stretch
Stretch used to display pixels.
void paintEvent(QPaintEvent *event)
Paint pixmap to the widget.
bool p_showText
Display text?
void setDn(const QString st)
Signal to set the DN label to st.
bool p_showDeviation
Display deviation?
int p_ulLine
Upper left line of region captured.
void setSamples(int samps)
Set box sample size.
QPixmap p_pixmap
Pixmap used for drawing.
void leaveEvent(QEvent *event)
Mouse left widget, update labels.
int p_oldHeight
Previous box height in pixels.
void setBoxSize(int size)
Set box size in pixels.
int p_boxHeight
Box height in pixels.
VisualDisplay(QWidget *parent=0)
Constructor for visual display.
void setSample(const QString st)
Signal to set the Sample label to st.
int p_ulSamp
Upper left sample of region captured.
void setLine(const QString st)
Signal to set the Line label to st.
int p_boxWidth
Box width in pixels.
void mouseMoveEvent(QMouseEvent *event)
Called when the mouse moves over this widget.
void setPixelData(QVector< QVector< double > > data, int samp, int line)
Set pixel data and upper left sample/line.
This is free and unencumbered software released into the public domain.
Definition Calculator.h:18
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16