4 //#include "wxContourEventHandler.h"
6 #include "interfNewContourMenu.h"
7 #include "interfIOMenu.h"
8 #include "interfEditMenu.h"
9 #include "interfDeleteMenu.h"
10 #include "interfToolsMenu.h"
11 #include "interfToolsSpreadPanel.h"
12 #include "interfSegmentationMenu.h"
13 #include "interfMenuBar.h"
14 #include "interfSegmentationPanels.h"
15 #include "interfToolsPanels.h"
17 #include <wx/treebook.h>
19 #include <wx/button.h>
20 #include <wx/stattext.h>
21 #include <wx/splitter.h>
22 #include <wx/statline.h>
24 #include "vtkImageData.h"
26 class interfMainPanel : public wxPanel {
30 interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir = "data/Icons");
31 ~interfMainPanel(void);
33 /** This method should be called the first time by the parent class
34 ** in creates all the panels the first time
36 static interfMainPanel* getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler=NULL );
37 /** This method should be called the first time by the parent class
38 ** in creates all the panels the first time
40 static interfMainPanel* getInstance(wxWindow* parent, wxEvtHandler * evtHandler=NULL);
42 ** Gets the instance of the class
44 static interfMainPanel* getInstance();
48 ** Adds a new checkbox to the scrolledwindow using the checkboxsizer
49 ** @Params id of contour
52 void addContourCheckBox(std::string id);
55 ** Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer)
56 ** @Params id of contour
59 void removeContourCheckBox(std::string id);
63 ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
64 ** of the button corresponding to the method that has to be executed,
65 ** it uses attribute eventHandler to call the methods define by the application.
66 ** see setEventHandler(wxEventHandler*)
68 void onActionButtonPressed1( wxCommandEvent& event );
71 ** Shows the panel in the
73 void showPanel(wxWindow* panel);
75 ** Gets the Information panel
77 wxPanel* getInfoPanel();
80 ** This methods connect the event in the class interfNewContourMenu with the world of the appli
82 void onCreateContourSpline( );
83 void onCreateContourRectangle( );
84 void onCreateContourCircle( );
85 void onCreateContourLine( );
86 void onCreateContoursBullEye(wxPanel* panBull);
87 /////////////////////////////////
88 void onDeleteContour();
89 void onDeleteContoursActSlice();
90 void onDeleteAllContours();
91 /////////////////////////
97 //////////////////////////
100 /////////////////////////////7
101 void RefreshInterface();
103 vtkImageData* getImageData();
105 void onSegmentationOneSlice(int isovalue,int sampling,int method);
107 int GetImageDataSizeZ();
109 void GetImageDataRange(double *range);
111 void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
115 void setLabelSegmentationPanelVTK(wxString tmpString);
117 void onSegmentationPressed();
119 void onSegmentationPressedITK();
121 void onRigidPressed();
123 void onWidthOfContour(double width);
125 int getColorWindow();
126 int getWindowLevel();
128 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
130 void onInterpolation(bool interpolate);
132 void onSpreadPressed();
134 void onConfigurationPressed();
140 void appendStringSpread(std::string val);
142 void onSpreadGo(int type);
144 void setStringSpread(std::string stringtemp);
146 void onInformationPressed();
149 void getInstantVector(std::vector<int>& tempVector);
151 std::vector<std::string> getOutlinesName(int slide);
153 void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ);
155 void setStringInfoPanel(wxString tmpString);
157 void setRowLabelInfoPanel(int z, wxString tempString);
159 int getNumberColsInformationPanel();
161 void appendColsInformationPanel(int _numberOfVariablesStatistics);
163 void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
165 void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
167 void onSaveResults(std::string directory,std::string namefile, std::string filename,int typeContourGroup);
169 wxString getCellValue(int j,int i);
171 void onSnakePressed();
173 void onMirrorPressed();
178 static interfMainPanel* interfmainpanel;
188 wxWindow* currentWindow;
189 wxSplitterWindow* splitterwindow;
193 wxStaticText* statictext;
194 wxStaticText* statictext1;
195 wxStaticText* statictext2;
196 wxStaticText* statictext3;
197 wxStaticText* statictext4;
198 wxStaticText* statictext5;
207 wxPanel* segmentPanel;
208 wxPanel* segmentationPanel;
209 wxPanel* segmentPanelITK;
210 wxPanel* configPanel;
211 wxPanel* spreadPanel;
212 interfSpreadPanel* panelSpread;
213 wxPanel* mirrorPanel;
214 interfMirrorPanel* panelMirror;
216 wxPanel* informationPanel;
221 //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
223 interfToolsSpreadPanel* toolspread;
226 ** This method initializes the tools panel, with the bar and the panel where the contours can be added
228 ** @params size of the buttons panel
229 ** @params sizey of the buttons panel
230 ** @params evtHandler this is the class in charge of responding to the events of the buttons
232 wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
235 ** initialize a statictext component of the interface
237 wxStaticText* getText(wxWindow* parent, std::string nom);
239 ** initializes a button with data
241 wxButton* getButton(wxWindow* parent);
243 ** Puts the panel button and the text int the sizer
245 wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);