Isis Developer Reference
StatisticsTool.h
Go to the documentation of this file.
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:
96 int p_boxSamps;
97 int p_boxLines;
98 int p_boxWidth;
99 int p_boxHeight;
100 int p_oldWidth;
101 int p_oldHeight;
102 int p_ulSamp;
103 int p_ulLine;
104 bool p_set;
105 bool p_showText;
106 bool p_showPixels;
107 bool p_showDeviation;
108
109 QPixmap p_pixmap;
110 Stretch p_stretch;
111 Statistics p_stats;
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
139 QAction *p_action;
140 QDialog *p_dialog;
141 QScrollArea *p_visualScroll;
142 QGroupBox *p_visualBox;
143 VisualDisplay *p_visualDisplay;
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
155 int p_boxSamps;
156 int p_boxLines;
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
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
Definition StatisticsTool.h:121
StatisticsTool(QWidget *parent)
Constructor, creates and sets up widgets for this tool.
Definition StatisticsTool.cpp:32
void resizeScrollbars()
Resize the scroll bars and center the point clicked.
Definition StatisticsTool.cpp:410
QAction * toolPadAction(ToolPad *toolpad)
Attaches this tool to the toolpad.
Definition StatisticsTool.cpp:182
QWidget * createToolBarWidget(QStackedWidget *parent)
Attaches this tool to the toolbar.
Definition StatisticsTool.cpp:201
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Called when a mouse button is released.
Definition StatisticsTool.cpp:255
void hideDisplay(bool hide)
Hide/Show the visual display.
Definition StatisticsTool.cpp:266
Pixel value mapper.
Definition Stretch.h:58
Base class for the Qisis tools.
Definition Tool.h:67
Definition ToolPad.h:14
Tool to visualize statistics in an n * m box.
Definition StatisticsTool.h:48
void showText(bool b)
Show/Hide text.
Definition StatisticsTool.cpp:529
void updateSize()
Update the size of the box.
Definition StatisticsTool.cpp:505
void showDeviation(bool b)
Show/Hide deviation.
Definition StatisticsTool.cpp:562
QSize sizeHint() const
Size hint for this widget.
Definition StatisticsTool.cpp:456
void setLines(int lines)
Set box line size.
Definition StatisticsTool.cpp:479
void showPixels(bool b)
Show/Hide pixels.
Definition StatisticsTool.cpp:546
void paintPixmap()
Paint the pixmap.
Definition StatisticsTool.cpp:624
void paintEvent(QPaintEvent *event)
Paint pixmap to the widget.
Definition StatisticsTool.cpp:702
void setDn(const QString st)
Signal to set the DN label to st.
void setSamples(int samps)
Set box sample size.
Definition StatisticsTool.cpp:465
void leaveEvent(QEvent *event)
Mouse left widget, update labels.
Definition StatisticsTool.cpp:745
void setBoxSize(int size)
Set box size in pixels.
Definition StatisticsTool.cpp:493
VisualDisplay(QWidget *parent=0)
Constructor for visual display.
Definition StatisticsTool.cpp:422
void setSample(const QString st)
Signal to set the Sample label to st.
void setLine(const QString st)
Signal to set the Line label to st.
void mouseMoveEvent(QMouseEvent *event)
Called when the mouse moves over this widget.
Definition StatisticsTool.cpp:717
void setPixelData(QVector< QVector< double > > data, int samp, int line)
Set pixel data and upper left sample/line.
Definition StatisticsTool.cpp:580
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