]> Creatis software - creaContours.git/blob - lib/Interface_Icons_NDimensions/interfMainPanel.h
*** empty log message ***
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMainPanel.h
1 #ifndef __interfMainPanel_h_INCLUDED_H__
2 #define __interfMainPanel_h_INCLUDED_H__
3
4 #pragma once
5
6 #include <wx/wx.h>
7 //#include "wxContourEventHandler.h"
8
9 #include "interfNewContourMenu.h"
10 #include "interfIOMenu.h"
11 #include "interfEditMenu.h"
12 #include "interfDeleteMenu.h"
13 #include "interfToolsMenu.h"
14 #include "interfToolsSpreadPanel.h"
15 #include "interfSegmentationMenu.h"
16 #include "interfMenuBar.h"
17 #include "interfSegmentationPanels.h"
18 #include "interfToolsPanels.h"
19
20 #include <wx/treebook.h>
21 #include <wx/sizer.h>
22 #include <wx/button.h>
23 #include <wx/stattext.h>
24 #include <wx/splitter.h>
25 #include <wx/statline.h>
26
27 #include "vtkImageData.h"
28
29 class interfMainPanel : public wxPanel {
30
31 public:
32         
33         interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir = "data/Icons");
34         ~interfMainPanel(void);
35
36         /**     This method should be called the first time by the parent class
37         **      in creates all the panels the first time
38         **/
39         static interfMainPanel* getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler=NULL );
40         /**     This method should be called the first time by the parent class
41         **      in creates all the panels the first time
42         **/
43         static interfMainPanel* getInstance(wxWindow* parent, wxEvtHandler * evtHandler=NULL);
44         /**
45         **      Gets the instance of the class
46         **/
47         static interfMainPanel* getInstance();
48         /**
49         **      Ressts the instance of the class
50         **/
51         static void resetInstance();
52
53         /**
54         **      Adds a new checkbox to the scrolledwindow using the checkboxsizer
55         **      @Params id of contour
56         **      
57         **/
58         void addContourCheckBox(std::string id);
59
60         /**
61         **      Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer)
62         **      @Params id of contour
63         **      
64         **/
65         void removeContourCheckBox(std::string id);
66
67
68         /**
69         **      Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
70         **      of the button corresponding to the method that has to be executed,
71         **      it uses attribute eventHandler to call the methods define by the application.
72         **      see setEventHandler(wxEventHandler*)
73         **/
74         void onActionButtonPressed1( wxCommandEvent& event );
75
76         /**
77         **      Shows the panel in the 
78         **/
79         void showPanel(wxWindow* panel);
80
81         /**
82         **      Hides the panel in the 
83         **/
84         void hidePanel( );
85
86         /**
87         **      Gets the Information panel
88         **/
89         wxPanel* getInfoPanel();
90         
91         /**
92         **      This methods connect the event in the class interfNewContourMenu with the world of the appli
93         **/
94         void onCreateContourSpline( );
95         void onCreateContourRectangle( );
96         void onCreateContourCircle( );
97         void onCreateContourLine( );
98         void onCreateContoursBullEye(wxPanel* panBull);
99         /////////////////////////////////
100         void onDeleteContour();
101         void onDeleteContoursActSlice();
102         void onDeleteAllContours();
103         /////////////////////////
104         void onCopy();
105         void onPaste();
106         void onUndo();
107         void onRedo();
108
109         //////////////////////////
110         void onLoad();
111         void onSave();
112 /////////////////////////////7
113         void RefreshInterface();
114
115         vtkImageData* getImageData();
116
117         void getImageRange(double[2]);
118
119         void onSegmentationOneSlice(int isovalue,int sampling,int method);
120
121         void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
122
123         int GetImageDataSizeZ();
124
125         void GetImageDataRange(double *range);
126
127         void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
128
129         void onMirrorPressed();
130
131         void onMirror();
132
133         void onMirrorAxisShow();
134
135         void onMirrorAxisHide();
136
137         void onMirrorChangeWidth(int width);
138
139         void onThreshold(int minVal, int maxVal);
140
141         void onThresholdChange(int minVal, int maxVal);
142
143         void onThresholdInstantChange(int range[]);
144
145         void onThresholdRemove();
146
147         void onThresholdPressed();
148
149         void onThresholdInterpolation(bool interpolate);
150
151         void onThresholdChangeOpacity (int opacity);
152
153         void setLabelSegmentationPanelVTK(wxString tmpString);
154
155         void onSegmentationPressed();
156
157         void onSegmentationPressedITK();
158
159         void onRigidPressed();
160
161         void onWidthOfContour(double width);
162
163         int getColorWindow();
164         int getWindowLevel();
165
166         void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
167
168         void onInterpolation(bool interpolate);
169
170         void onSpreadPressed();
171
172         void onConfigurationPressed();
173
174         void resetAppend();
175
176         void onSpreadAdd();
177
178         void appendStringSpread(std::string val);
179
180         void onSpreadGo(int type);
181
182         void setStringSpread(std::string stringtemp);
183
184         void onInformationPressed();
185
186         
187         void getInstantVector(std::vector<int>& tempVector);
188
189         std::vector<std::string> getOutlinesName(int slide);
190
191         void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ);
192
193         void setStringInfoPanel(wxString tmpString);    
194
195         void setRowLabelInfoPanel(int z, wxString tempString);
196
197         int getNumberColsInformationPanel();
198         
199         void appendColsInformationPanel(int _numberOfVariablesStatistics);
200
201         void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
202
203         void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
204
205         void onSaveResults(std::string directory,std::string namefile, std::string filename,int typeContourGroup);
206
207         wxString getCellValue(int j,int i);
208
209         void onSnakePressed();
210
211 private:
212         
213
214         static interfMainPanel* interfmainpanel;
215
216
217         wxPanel* menubar;
218         wxPanel* menubar1;
219         wxPanel* menubar2;
220         wxPanel* menubar3;
221         wxPanel* menubar4;
222         wxPanel* menubar5;
223
224         wxWindow* currentWindow;
225         wxSplitterWindow* splitterwindow;
226
227         wxPanel* infoPanel;
228
229         wxStaticText* statictext;
230         wxStaticText* statictext1;
231         wxStaticText* statictext2;
232         wxStaticText* statictext3;
233         wxStaticText* statictext4;
234         wxStaticText* statictext5;
235
236         std::string PANEL;
237         std::string PANEL1;
238         std::string PANEL2;
239         std::string PANEL3;
240         std::string PANEL4;
241         std::string PANEL5;
242
243         wxPanel* segmentPanel;
244         wxPanel* segmentationPanel;
245         wxPanel* segmentPanelITK;
246         wxPanel* configPanel;
247         wxPanel* spreadPanel;
248         interfSpreadPanel* panelSpread;
249         wxWindow* infoWin;
250         wxPanel* informationPanel;
251         
252         wxPanel* mirrorPanel;
253         interfMirrorPanel* panelMirror; 
254         wxPanel* thresholdPanel;
255         interfThresholdPanel* panelThreshold;
256
257         bool axisshown;
258         bool refLineShown;
259         
260         //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
261         //list of contours
262         interfToolsSpreadPanel* toolspread;
263
264         /**
265         **      This method initializes the tools panel, with the bar and the panel where the contours can be added
266         **      and removed.
267         **      @params size of the buttons panel
268         **      @params sizey of the buttons panel
269         **      @params evtHandler this is the class in charge of responding to the events of the buttons
270         **/
271         wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
272
273         /**
274         **      initialize a statictext component of the interface
275         **/
276         wxStaticText* getText(wxWindow* parent, std::string nom);
277         /**
278         ** initializes a button with data
279         **/
280         wxButton* getButton(wxWindow* parent);
281         /**
282         ** Puts the panel button and the text int the sizer
283         **/
284         wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);
285
286         
287 };
288
289 #endif
290