-
Notifications
You must be signed in to change notification settings - Fork 10
/
profile_widget.h
124 lines (98 loc) · 3.17 KB
/
profile_widget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef MEAN_PROFILE_WIDGET_H
#define MEAN_PROFILE_WIDGET_H
/* Standard includes */
#include <atomic>
/* Qt includes */
#include <QCheckBox>
#include <QTimer>
#include <QVBoxLayout>
#include <QWidget>
/* Live View includes */
#include "qcustomplot.h"
#include "frame_worker.h"
#include "image_type.h"
#include "frameview_widget.h"
#include "startupOptions.h"
/*! \file
* \brief Widget which displays a line plot of two dimensions of image data.
* \paragraph
*
* profile_widget accepts processed mean data with adjustable parameters. That is, the user may select to view the mean of all rows across a
* specific column (vertical mean profile), or of all columns across a specific row (horizontal mean profile). Additionally, there is the option
* to have Vertical or Horizontal Crosshair Profiles which offer flexibility in the number of rows or columns to average. For example, a vertical
* crosshair profile centered at x = 300 would contain the image data for column 300 averaged with the data for any number of other columns up to
* the width of the frame.
* \author Jackie Ryan
* \author Noah Levy
*/
class profile_widget : public QWidget
{
Q_OBJECT
frameWorker *fw;
QTimer rendertimer;
startupOptionsType options;
/* GUI elements */
QVBoxLayout qvbl; // for others
QGridLayout qgl; // for overlay
QVBoxLayout op_vert; // overlay plot vertical layout option
QHBoxLayout horiz_layout; // bottom of profile plot check boxes
QCheckBox *showCalloutCheck;
QCheckBox * zoomX_enable_Check;
QCheckBox * zoomY_enable_Check;
QCPItemText *callout;
QCPItemLine *arrow;
QSpacerItem * spacer;
QPushButton * reset_zoom_btn;
/* Plot elements */
QCustomPlot *qcp;
QCPPlotTitle *plotTitle;
/* Frame rendering elements */
int frWidth, frHeight;
int xAxisMax = 0;
volatile double ceiling;
volatile double floor;
QVector<double> x;
QVector<double> y;
QVector<double> y_lh;
QVector<double> y_rh;
QCPRange boundedRange_x;
QCPRange boundedRange_y;
int x_coord = 1;
int y_coord = 1;
bool allow_callouts = true;
public:
explicit profile_widget(frameWorker *fw, image_t image_type , QWidget *parent = 0);
virtual ~profile_widget();
/*! \addtogroup getters
* @{ */
double getCeiling();
double getFloor();
/*! @} */
const unsigned int slider_max = (1<<16) * 1.1;
bool slider_low_inc = false;
image_t itype;
frameview_widget *overlay_img = NULL; // public to aid connection through the profile to the controls box
public slots:
/*! \addtogroup renderfunc
* @{ */
void handleNewFrame();
/*! @} */
/*! \addtogroup plotfunc
* @{ */
void updateCeiling(int c);
void updateFloor(int f);
void rescaleRange();
void profileScrolledX(const QCPRange &newRange);
void profileScrolledY(const QCPRange &newRange);
/*! @} */
void defaultZoom();
void setCallout(QMouseEvent *e);
void moveCallout(QMouseEvent *e);
void hideCallout();
void setPenWidth(int penWidth);
signals:
void haveNewRangeFC(double floor, double ceiling);
private:
void updateCalloutValue();
};
#endif // MEAN_PROFILE_WIDGET_H