mainwindow.h
1.73 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "spectrumwindow.h"
#include <QMainWindow>
#include <QMouseEvent>
//stim libraries
#include "stim/envi/envi.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void mousePressEvent(QMouseEvent* event); //handles when the image is clicked
void resizeEvent(QResizeEvent* event); //handles when the window is resized
void mousePressSpectrum(double x, double y); //handles when the user picks the spectrum
void loadImage(QString filename); //loads a hyperspectral image
private slots:
void on_actionLoad_triggered();
private:
Ui::MainWindow *ui;
QGraphicsScene* scene; //scene containing the image and any drawn UI elements
QPixmap image; //stores the pixels for the current band
QPixmap main_image; //stores the pixels for the image displayed in the main view (may be scaled)
//coordinates of the picked position in image space [0, 1]
double px;
double py;
SpectrumWindow* s; //window displaying the spectrum of the selected pixel
stim::envi hsi; //data structure storing the current hyperspectral image
QVector<double> x; //x values for the spectrum
QVector<double> y; //y values for the spectrum
void load_band(unsigned int i); //loads an image of a band from the HSI and stores it in the global variable image
void draw_viewport(); //draws the viewport, including the image and overlay
void draw_overlay(); //draws an overlay showing the picked position
void load_spectrum(); //loads a spectrum from the HSI and stores it in the global variable y
void draw_spectrum(); //sends a spectrum to the SpectrumWindow for plotting
};
#endif // MAINWINDOW_H