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();
114 vtkImageData* getImageData();
115 void getImageRange(double[2]);
116 void onSegmentationOneSlice(int isovalue,int sampling,int method);
117 void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
118 int GetImageDataSizeZ();
119 void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
120 void onMirrorPressed();
122 void onMirrorAxisShow();
123 void onMirrorAxisHide();
124 void onMirrorChangeWidth(int width);
125 void onThresholdPressed();
126 void setLabelSegmentationPanelVTK(wxString tmpString);
127 void onSegmentationPressed();
128 void onSegmentationPressedITK();
129 void onRigidPressed();
130 void onWidthOfContour(double width);
131 int getColorWindow();
132 int getWindowLevel();
133 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
134 void onInterpolation(bool interpolate);
135 void onSpreadPressed();
136 void onConfigurationPressed();
139 void appendStringSpread(std::string val);
140 void onSpreadGo(int type);
141 void setStringSpread(std::string stringtemp);
142 void onInformationPressed();
143 void getInstantVector(std::vector<int>& tempVector);
144 std::vector<std::string> getOutlinesName(int slide);
145 void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ,int grayRangeMin,int grayRangeMax);
146 void setStringInfoPanel(wxString tmpString);
147 void setRowLabelInfoPanel(int z, wxString tempString);
148 int getNumberColsInformationPanel();
149 void appendColsInformationPanel(int _numberOfVariablesStatistics);
150 void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
151 void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
152 void onSaveResults(std::string directory,std::string namefile, std::string filename,
153 int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
154 wxString getCellValue(int j,int i);
155 void onSnakePressed();
156 virtual bool Show(bool show);
157 void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ);
158 void SetContourGroup(int contourGroup);
163 static interfMainPanel* interfmainpanel;
166 static wxFrame* _newframe;
174 wxWindow* currentWindow;
175 wxSplitterWindow* splitterwindow;
178 wxPanel* infoPanelMask;
180 wxStaticText* statictext;
181 wxStaticText* statictext1;
182 wxStaticText* statictext2;
183 wxStaticText* statictext3;
184 wxStaticText* statictext4;
185 wxStaticText* statictext5;
194 wxPanel* segmentPanel;
195 wxPanel* segmentationPanel;
196 wxPanel* segmentPanelITK;
197 wxPanel* configPanel;
198 wxPanel* spreadPanel;
199 interfSpreadPanel* panelSpread;
201 wxPanel* informationPanel;
203 wxPanel* mirrorPanel;
204 interfMirrorPanel* panelMirror;
205 wxPanel* thresholdPanel;
210 //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
212 interfToolsSpreadPanel* toolspread;
215 ** This method initializes the tools panel, with the bar and the panel where the contours can be added
217 ** @params size of the buttons panel
218 ** @params sizey of the buttons panel
219 ** @params evtHandler this is the class in charge of responding to the events of the buttons
221 wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
224 ** initialize a statictext component of the interface
226 wxStaticText* getText(wxWindow* parent, std::string nom);
228 ** initializes a button with data
230 wxButton* getButton(wxWindow* parent);
232 ** Puts the panel button and the text int the sizer
234 wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);