3D Human Airway Tree
Program generuje ludzkie drzewo oskrzelowe
3DTreeGUI.h
Idź do dokumentacji tego pliku.
1 /*=========================================================================
2 
3  Program: 3D Human Airway Tree
4  Module: 3DTreeGUI.h
5 
6  Copyright (c) Kacper Pluta <kacperp@wsinf.edu.pl>
7  All rights reserved.
8  See Copyright.txt or http://leo.wsinf.edu.pl/~kacperp/3dtree for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 #ifndef ThreeDTreeGUI_H
17 #define ThreeDTreeGUI_H
18 
19 #include <QAction>
20 #include <QCheckBox>
21 #include <QRadioButton>
22 #include <QtGui/QMainWindow>
23 #include <QVTKWidget.h>
24 #include <vtkRenderer.h>
25 #include <vtkRenderWindow.h>
26 #include <QSplitter>
27 #include <QVBoxLayout>
28 #include <QLabel>
29 #include <QTabWidget>
30 #include <QPushButton>
31 #include <vtkImageData.h>
32 #include <QSpinBox>
33 #include <QToolBox>
34 #include <QCheckBox>
35 #include <pinkRawToPgm.h>
36 #include <pinkEden.h>
37 #include <pinkSeuil.h>
38 
39 #include "CompueTree.h"
40 #include <vtkMetaImageWriter.h>
41 #include <vtkRenderer.h>
42 #include <vtkImageCast.h>
43 #include <vtkMetaImageReader.h>
44 #include <vtkPolyDataMapper.h>
45 #include <vtkLODActor.h>
46 #include <vtkContourFilter.h>
47 #include <vtkAppendPolyData.h>
48 #include <pinkFrame.h>
49 #include <pinkSub.h>
50 #include <pinkAsft.h>
51 #include <pinkPgmToRaw.h>
52 #include <PrepareFile.h>
53 
54 class ThreeDTreeGUI : public QMainWindow
55 {
56  Q_OBJECT
57 private:
58  QVTKWidget *vtkWidget;
59  vtkRenderer *ren;
60  QAction *saveAction;
61  QAction *closeAction;
62  QList <QAction* > fileMenuBarActions;
63  QSplitter *splitter;
64  QWidget *leftPanel;
65  QVBoxLayout *layout;
66  QLabel *label0;
67  QWidget *mainTab;
68  QWidget *edenTab;
69  QTabWidget *tabMenu;
70  QLabel *infoBox;
71  QSpinBox *mainTabDiameterSpinBox;
72  QDoubleSpinBox *mainTabSpacingSpinBox;
73  QPushButton *generateButton;
74  QPushButton *restartNoiseButton;
75  QLabel *mainTablabel1;
76  QLabel *mainTablabel0;
77  QVBoxLayout *mainTabLayout;
78  QVBoxLayout *edenTabLayout;
79  QVBoxLayout *noiseTabLayout;
80  QWidget *noiseTab;
81  QToolBox *noiseBox;
82  QCheckBox *edenPlus;
83  QCheckBox *edenMinus;
84  QLabel *edenPercentLabel;
85  QSpinBox *edenPercent;
86  QLabel *edenPointConnection;
87  QPushButton *addEdenButton;
88 
89  QRadioButton *edenNeighborhoodConnections0;
90  QRadioButton *edenNeighborhoodConnections6;
91  QRadioButton *edenNeighborhoodConnections26;
92 
93  QVBoxLayout *asftTabLayout;
94  QWidget *asftTab;
95  QLabel *asftRadiusLabel;
96  QSpinBox *asftRadius;
97  QPushButton *addAsftButton;
98 
99  QVBoxLayout *bigNoiseTabLayout;
100  QWidget *bigNoiseTab;
101  QLabel *bigNoiseRadiusLabel;
102  QSpinBox *bigNoiseRadius;
103  QPushButton *addBigNoiseButton;
104 
105 
106  QWidget *prepareTab;
107  QVBoxLayout *prepareTabLayout;
108 
109  QLabel *backgroundValueLabel;
110  QSpinBox *backgroundValue;
111  QLabel *intervalLLabel;
112  QLabel *intervalRLabel;
113  QSpinBox *intervalLValue;
114  QSpinBox *intervalRValue;
115  QPushButton *preparePGMButton;
116 
117  long long unsigned int voxCount;
118 
119  int dims[3];
120 
121  ComputeThread *treeThread;
122  PrepareFile *prepareThread;
123 
124  vtkImageData *rawTree;
125  vtkContourFilter *treeContour;
126  vtkPolyDataMapper *treeMapper;
127  vtkLODActor *treeActor;
128  vtkMetaImageWriter *metaWriter;
129  vtkMetaImageReader *metaReader;
130  bool isNoise;
131 
132  pinkRawToPgm *raw2PgmThread;
133  pinkPgmToRaw *pgm2RawThread;
134  pinkEden *edenThread;
135  pinkSeuil *seuilThread;
136  pinkFrame *frameThread;
137  pinkSub *subThread;
138  pinkAsft *asftThread;
139 
140 private slots:
141  void save();
142  void printDiameterInfo();
143  void printSpacingInfo();
144  void generateTree();
145  void refresh(QThread *);
146  void raw2PgmPink(vtkImageData *p_rawTree, QThread *p);
147  void pgm2RawPink(QThread *p);
148  void seuilPink(QThread *);
149  void framePink(QThread *);
150  void subPink(QThread *);
151  void removeNoisePink();
152  void checkEdenOption();
153  void addEden();
154  void addAsft();
155  void addEdenForBigNoise();
156  void terminateThread(QThread *);
157  void preparePGMFile();
158  void addAsftForBigNoise(QThread *);
159 public:
160  ThreeDTreeGUI();
161  virtual ~ThreeDTreeGUI();
162 };
163 
164 #endif // ThreeDTreeGUI_H