-
Notifications
You must be signed in to change notification settings - Fork 2
/
application.h
153 lines (129 loc) · 3.45 KB
/
application.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#ifndef APPLICATION_H
#define APPLICATION_H
#include "point.h"
#include "snake.h"
#include "ui_application.h"
#include "dialog.h"
#include "scene.h"
//#include "ui_dialog.h"
//#include "itkGradientImageFilter.h"
#include <QtGui>
#include <QFlags>
//typedef unsigned char UnsignedCharPixelType;
//typedef float FloatPixelType;
////typedef itk::RGBPixel<unsigned char> RGBPixelType;
//typedef itk::Image<FloatPixelType, 2> FloatImageType;
//typedef itk::Image<UnsignedCharPixelType,2> UnsignedCharImageType;
//typedef FloatImageType ImageType;
////typedef itk::ImageFileReader<ImageType> ReaderType;
typedef itk::ImageFileReader<ImageType> ReaderType;
class Application : public QMainWindow
{
Q_OBJECT
public:
Application(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~Application();
//void paintEvent(QPaintEvent*);
private slots:
//void mouseMoveEvent(QMouseEvent *e);
public slots:
void slotExit();
void slotOpen();
void slotOpenShape();
void slotSave();
void slotGo();
void slotTest();
void slotContinue();
void slotStop();
void slotUpdateParameters();
void slotRotateSnake();
void slotShiftSnake();
void slotDefineInitSnake();
void slotUpdatePreprocessingParameters();
void slotCompute();
void slotBrowseGroundTruth();
void slotBrowseSnakeFile();
void slotRebuild();
private:
void display();
private:
bool isInPhase1, isInPhase2, isInPhaseChangeSP;
/*Private attributes*/
double sigma,threshold;
int width, height;
QImage image, gradImageBeforeThresholding, gradImageAfterThresholding, flowImage;
QRgb pixel;
ReaderType::Pointer reader;
QString groundTruthFile;
//User interface parameters
Ui::ApplicationClass ui;
Scene* sceneMain;
Scene* sceneSnake;
Scene* scene1;
Scene* scene2;
Scene* scene3;
Scene* scene4;
Scene* scenePostProcessing;
QPen pen;
//QPen penblue;
ImageType::Pointer floatGradient;
ImageType::Pointer floatFlow;
bool stop;
int loop;
//
QString theFileName;
Snake s;
PointList theShape;
PointList groundTruth;
PointList aSnake;
double continuityCoeff;
double curvatureCoeff;
double imageCoeff;
double flowCoeff;
double balloonCoeff;
double priorCoeff;
double continuityBegin;
double curvatureBegin;
double imageBegin;
double flowBegin;
double balloonBegin;
double priorBegin;
double continuityEnd;
double curvatureEnd;
double imageEnd;
double flowEnd;
double balloonEnd;
double priorEnd;
double continuityStep;
double curvatureStep;
double imageStep;
double flowStep;
double balloonStep;
double priorStep;
int maxIterations;
bool autoAdaptation;
int autoAdaptLoop;
int minLength;
int maxLength;
bool enableSPI;
bool autoShifting;
//Parameters for the 1st step of the auto-run scheme
double continuityCoeff_2;
double curvatureCoeff_2;
double flowCoeff_2;
int maxIterations_2;
bool autoAdaptation_2;
int autoAdaptLoop_2;
int minLength_2;
int maxLength_2;
/*Private methods*/
void getParameters();
void updateMainView();
void updateSnakeView();
//void updateShapeView();
void updateAllViews();
void disallowChangingParameters();
void allowChangingParameters();
void run();
};
#endif // APPLICATION_H