creaContours_lib
interfMainPanel.h
Go to the documentation of this file.
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 # pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
15 #
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
20 # liability.
21 #
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25 
26 #ifndef __interfMainPanel_h_INCLUDED_H__
27 #define __interfMainPanel_h_INCLUDED_H__
28 
29 #pragma once
30 
31 #include <wx/wx.h>
32 //#include "wxContourEventHandler.h"
33 
34 #include "interfNewContourMenu.h"
35 #include "interfIOMenu.h"
36 #include "interfEditMenu.h"
37 #include "interfDeleteMenu.h"
38 #include "interfToolsMenu.h"
39 #include "interfToolsSpreadPanel.h"
40 #include "interfSegmentationMenu.h"
41 #include "interfMenuBar.h"
42 #include "interfToolsPanels.h"
44 #include "interfImageToolsMenu.h"
45 
46 #include <wx/treebook.h>
47 #include <wx/sizer.h>
48 #include <wx/button.h>
49 #include <wx/stattext.h>
50 #include <wx/splitter.h>
51 #include <wx/statline.h>
52 
53 #include "vtkImageData.h"
54 
55 class interfMainPanel : public wxPanel {
56 
57 public:
58 
59  interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir = "data/Icons");
60  ~interfMainPanel(void);
61 
65  static interfMainPanel* getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler=NULL );
69  static interfMainPanel* getInstance(wxWindow* parent, wxEvtHandler * evtHandler=NULL);
73  static interfMainPanel* getInstance();
77  static void resetInstance();
78 
84  void addContourCheckBox(std::string id);
85 
91  void removeContourCheckBox(std::string id);
92 
93 
100  void onActionButtonPressed1( wxCommandEvent& event );
101 
105  void showPanel(wxWindow* panel);
106 
110  void hidePanel( );
111 
115  wxPanel* getInfoPanel();
116 
120  void onCreateContourSpline( );
121  void onCreateContourRectangle( );
122  void onCreateContourCircle( );
123  void onCreateContourLine( );
124  // RaC 09-09 ---------------------
125  void onCreateContourPoints( );
126  // RaC 09-09 ---------------------
127 
128  // RaC 10-09 ---------------------
129  void onCreateContourPolygon( );
130  // RaC 10-09 ---------------------
131 
132  void onCreateContoursBullEye(wxPanel* panBull);
134  void onDeleteContour();
136  void onDeleteAllContours();
138  void onCopy();
139  void onPaste();
140  void onUndo();
141  void onRedo();
142 
144  void onLoad();
145  void onSave();
146  void onImport();
147  void onTest();
149  void RefreshInterface();
150  vtkImageData* getImageData();
151  void getImageRange(double[2]);
152  void onSegmentationOneSlice(int isovalue,int sampling,int method);
153  void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
154  int GetImageDataSizeZ();
155  void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
156  void onMirrorPressed();
157  void onMirror();
158  void onMirrorAxisShow();
159  void onMirrorAxisHide();
160  void onMirrorChangeWidth(int width);
161  void onThresholdPressed();
163  void setLabelSegmentationPanelVTK(wxString tmpString);
164  void onSegmentationPressed();
166  void onRigidPressed();
167  void onWidthOfContour(double width);
168  int getColorWindow();
169  int getWindowLevel();
170  void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
171  void onInterpolation(bool interpolate);
172  void onSpreadPressed();
173  void onConfigurationPressed();
174  void resetAppend();
175  void onSpreadAdd();
176  void onSpreadAddAll();
177  void appendStringSpread(std::string val);
178  void onSpreadGo(int type);
179  void setStringSpread(std::string stringtemp);
180  void onInformationPressed();
181  void getInstantVector(std::vector<int>& tempVector);
182  std::vector<std::string> getOutlinesName(int slide);
183  void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ,int grayRangeMin,int grayRangeMax);
184  void setStringInfoPanel(wxString tmpString);
185  void setRowLabelInfoPanel(int z, wxString tempString);
187  void appendColsInformationPanel(int _numberOfVariablesStatistics);
188  void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
189  void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
190  void SetScalarRange(int grayRangeMin,int grayRangeMax);
191  void onSaveResults(std::string directory,std::string namefile, std::string filename,
192  int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
193  wxString getCellValue(int j,int i);
194  void onSnakePressed();
195  virtual bool Show(bool show);
196  void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ);
197  void SetContourGroup(int contourGroup);
198 
199 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
200 
204  void onPrintLabel();
205 
206 
212  void onCalibration(wxString size, int unit);
213 
219  double onePixelSize (double realSize,double sizePixel);
220 
224  double GetPixelValue();
225 //------------------------------------------------------------------------------------------------------------
226 
227 private:
228 
229 
231 
232 
233  static wxFrame* _newframe;
234  wxPanel* menubar;
235  wxPanel* menubar1;
236  wxPanel* menubar2;
237  wxPanel* menubar3;
238  wxPanel* menubar4;
239  wxPanel* menubar5;
240  wxPanel* menubar6;
241 
242  wxWindow* currentWindow;
243  wxSplitterWindow* splitterwindow;
244 
245  wxPanel* infoPanel;
246  wxPanel* infoPanelMask;
247 
248 //CMRU 17-08-09 ------------------------------------------------------------------
249 
254 
258  wxPanel* panelAux;
259 
263  double _pixelValue;
264 //--------------------------------------------------------------------------------
265 
266  wxStaticText* statictext;
267  wxStaticText* statictext1;
268  wxStaticText* statictext2;
269  wxStaticText* statictext3;
270  wxStaticText* statictext4;
271  wxStaticText* statictext5;
272  wxStaticText* statictext6;
273 
274  std::string PANEL;
275  std::string PANEL1;
276  std::string PANEL2;
277  std::string PANEL3;
278  std::string PANEL4;
279  std::string PANEL5;
280  std::string PANEL6;
281 
282  wxPanel *segmentPanel;
284  wxPanel *segmentPanelITK;
285  wxPanel *configPanel;
286  wxPanel *spreadPanel;
288  wxWindow *infoWin;
290 
291  wxPanel *testPanel;
293 
294  wxPanel *mirrorPanel;
296 
297  wxPanel *thresholdPanel;
299 
300  bool axisshown;
302 
303  //This attribute contains the panel in charge of adding and removing the corresponding checkboxes in
304  //list of contours
306 
314  wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
315 
319  wxStaticText* getText(wxWindow* parent, std::string nom);
323  wxButton* getButton(wxWindow* parent);
327  wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);
328 
329 
330 };
331 
332 #endif
333