]> Creatis software - creaContours.git/blob - lib/Interface_Icons_NDimensions/interfMainPanel.h
no newline at end of file
[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 onMirror();
130
131         void onMirrorChangeWidth(int width);
132
133         void onThreshold(int minVal, int maxVal);
134
135         void onThresholdPressed();
136
137         void setLabelSegmentationPanelVTK(wxString tmpString);
138
139         void onSegmentationPressed();
140
141         void onSegmentationPressedITK();
142
143         void onRigidPressed();
144
145         void onWidthOfContour(double width);
146
147         int getColorWindow();
148         int getWindowLevel();
149
150         void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
151
152         void onInterpolation(bool interpolate);
153
154         void onSpreadPressed();
155
156         void onConfigurationPressed();
157
158         void resetAppend();
159
160         void onSpreadAdd();
161
162         void appendStringSpread(std::string val);
163
164         void onSpreadGo(int type);
165
166         void setStringSpread(std::string stringtemp);
167
168         void onInformationPressed();
169
170         
171         void getInstantVector(std::vector<int>& tempVector);
172
173         std::vector<std::string> getOutlinesName(int slide);
174
175         void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ);
176
177         void setStringInfoPanel(wxString tmpString);    
178
179         void setRowLabelInfoPanel(int z, wxString tempString);
180
181         int getNumberColsInformationPanel();
182         
183         void appendColsInformationPanel(int _numberOfVariablesStatistics);
184
185         void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
186
187         void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
188
189         void onSaveResults(std::string directory,std::string namefile, std::string filename,int typeContourGroup);
190
191         wxString getCellValue(int j,int i);
192
193         void onSnakePressed();
194
195         void onMirrorPressed();
196
197 private:
198         
199
200         static interfMainPanel* interfmainpanel;
201
202
203         wxPanel* menubar;
204         wxPanel* menubar1;
205         wxPanel* menubar2;
206         wxPanel* menubar3;
207         wxPanel* menubar4;
208         wxPanel* menubar5;
209
210         wxWindow* currentWindow;
211         wxSplitterWindow* splitterwindow;
212
213         wxPanel* infoPanel;
214
215         wxStaticText* statictext;
216         wxStaticText* statictext1;
217         wxStaticText* statictext2;
218         wxStaticText* statictext3;
219         wxStaticText* statictext4;
220         wxStaticText* statictext5;
221
222         std::string PANEL;
223         std::string PANEL1;
224         std::string PANEL2;
225         std::string PANEL3;
226         std::string PANEL4;
227         std::string PANEL5;
228
229         wxPanel* segmentPanel;
230         wxPanel* segmentationPanel;
231         wxPanel* segmentPanelITK;
232         wxPanel* configPanel;
233         wxPanel* spreadPanel;
234         interfSpreadPanel* panelSpread;
235         wxWindow* infoWin;
236         wxPanel* informationPanel;
237         
238         wxPanel* mirrorPanel;
239         interfMirrorPanel* panelMirror; 
240         wxPanel* thresholdPanel;
241         interfThresholdPanel* panelThreshold;
242
243         bool axisshown;
244         bool refLineShown;
245         bool thresholdShown;
246         
247         //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
248         //list of contours
249         interfToolsSpreadPanel* toolspread;
250
251         /**
252         **      This method initializes the tools panel, with the bar and the panel where the contours can be added
253         **      and removed.
254         **      @params size of the buttons panel
255         **      @params sizey of the buttons panel
256         **      @params evtHandler this is the class in charge of responding to the events of the buttons
257         **/
258         wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
259
260         /**
261         **      initialize a statictext component of the interface
262         **/
263         wxStaticText* getText(wxWindow* parent, std::string nom);
264         /**
265         ** initializes a button with data
266         **/
267         wxButton* getButton(wxWindow* parent);
268         /**
269         ** Puts the panel button and the text int the sizer
270         **/
271         wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);
272
273         
274 };
275
276 #endif
277