1 #ifndef __interfMainPanel_h_INCLUDED_H__
2 #define __interfMainPanel_h_INCLUDED_H__
7 //#include "wxContourEventHandler.h"
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"
20 #include <wx/treebook.h>
22 #include <wx/button.h>
23 #include <wx/stattext.h>
24 #include <wx/splitter.h>
25 #include <wx/statline.h>
27 #include "vtkImageData.h"
29 class interfMainPanel : public wxPanel {
33 interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir = "data/Icons");
34 ~interfMainPanel(void);
36 /** This method should be called the first time by the parent class
37 ** in creates all the panels the first time
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
43 static interfMainPanel* getInstance(wxWindow* parent, wxEvtHandler * evtHandler=NULL);
45 ** Gets the instance of the class
47 static interfMainPanel* getInstance();
49 ** Ressts the instance of the class
51 static void resetInstance();
54 ** Adds a new checkbox to the scrolledwindow using the checkboxsizer
55 ** @Params id of contour
58 void addContourCheckBox(std::string id);
61 ** Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer)
62 ** @Params id of contour
65 void removeContourCheckBox(std::string id);
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*)
74 void onActionButtonPressed1( wxCommandEvent& event );
77 ** Shows the panel in the
79 void showPanel(wxWindow* panel);
82 ** Hides the panel in the
87 ** Gets the Information panel
89 wxPanel* getInfoPanel();
92 ** This methods connect the event in the class interfNewContourMenu with the world of the appli
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 /////////////////////////
109 //////////////////////////
112 /////////////////////////////7
113 void RefreshInterface();
115 vtkImageData* getImageData();
117 void getImageRange(double[2]);
119 void onSegmentationOneSlice(int isovalue,int sampling,int method);
121 void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
123 int GetImageDataSizeZ();
125 void GetImageDataRange(double *range);
127 void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
129 void onMirrorPressed();
133 void onMirrorAxisShow();
135 void onMirrorAxisHide();
137 void onMirrorChangeWidth(int width);
141 void onThresholdChange();
143 void onThresholdInstantChange(double range[]);
145 void onThresholdRemove();
147 void onThresholdPressed();
149 void onThresholdInterpolation(bool interpolate);
151 void onThresholdChangeOpacity (int opacity);
153 void setLabelSegmentationPanelVTK(wxString tmpString);
155 void onSegmentationPressed();
157 void onSegmentationPressedITK();
159 void onRigidPressed();
161 void onWidthOfContour(double width);
163 int getColorWindow();
164 int getWindowLevel();
166 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
168 void onInterpolation(bool interpolate);
170 void onSpreadPressed();
172 void onConfigurationPressed();
178 void appendStringSpread(std::string val);
180 void onSpreadGo(int type);
182 void setStringSpread(std::string stringtemp);
184 void onInformationPressed();
187 void getInstantVector(std::vector<int>& tempVector);
189 std::vector<std::string> getOutlinesName(int slide);
191 void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ);
193 void setStringInfoPanel(wxString tmpString);
195 void setRowLabelInfoPanel(int z, wxString tempString);
197 int getNumberColsInformationPanel();
199 void appendColsInformationPanel(int _numberOfVariablesStatistics);
201 void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
203 void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
205 void onSaveResults(std::string directory,std::string namefile, std::string filename,int typeContourGroup);
207 wxString getCellValue(int j,int i);
209 void onSnakePressed();
211 virtual bool Show(bool show);
216 static interfMainPanel* interfmainpanel;
219 static wxFrame* _newframe;
227 wxWindow* currentWindow;
228 wxSplitterWindow* splitterwindow;
232 wxStaticText* statictext;
233 wxStaticText* statictext1;
234 wxStaticText* statictext2;
235 wxStaticText* statictext3;
236 wxStaticText* statictext4;
237 wxStaticText* statictext5;
246 wxPanel* segmentPanel;
247 wxPanel* segmentationPanel;
248 wxPanel* segmentPanelITK;
249 wxPanel* configPanel;
250 wxPanel* spreadPanel;
251 interfSpreadPanel* panelSpread;
253 wxPanel* informationPanel;
255 wxPanel* mirrorPanel;
256 interfMirrorPanel* panelMirror;
257 wxPanel* thresholdPanel;
258 interfThresholdPanel* panelThreshold;
263 //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
265 interfToolsSpreadPanel* toolspread;
268 ** This method initializes the tools panel, with the bar and the panel where the contours can be added
270 ** @params size of the buttons panel
271 ** @params sizey of the buttons panel
272 ** @params evtHandler this is the class in charge of responding to the events of the buttons
274 wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
277 ** initialize a statictext component of the interface
279 wxStaticText* getText(wxWindow* parent, std::string nom);
281 ** initializes a button with data
283 wxButton* getButton(wxWindow* parent);
285 ** Puts the panel button and the text int the sizer
287 wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);