00001 #ifndef __interfMainPanel_h_INCLUDED_H__
00002 #define __interfMainPanel_h_INCLUDED_H__
00003
00004 #pragma once
00005
00006 #include <wx/wx.h>
00007
00008
00009 #include "interfNewContourMenu.h"
00010 #include "interfIOMenu.h"
00011 #include "interfEditMenu.h"
00012 #include "interfDeleteMenu.h"
00013 #include "interfToolsMenu.h"
00014 #include "interfToolsSpreadPanel.h"
00015 #include "interfSegmentationMenu.h"
00016 #include "interfMenuBar.h"
00017 #include "interfToolsPanels.h"
00018 #include "interfSegmentationPanels.h"
00019 #include "interfImageToolsMenu.h"
00020
00021 #include <wx/treebook.h>
00022 #include <wx/sizer.h>
00023 #include <wx/button.h>
00024 #include <wx/stattext.h>
00025 #include <wx/splitter.h>
00026 #include <wx/statline.h>
00027
00028 #include "vtkImageData.h"
00029
00030 class interfMainPanel : public wxPanel {
00031
00032 public:
00033
00034 interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir = "data/Icons");
00035 ~interfMainPanel(void);
00036
00040 static interfMainPanel* getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler=NULL );
00044 static interfMainPanel* getInstance(wxWindow* parent, wxEvtHandler * evtHandler=NULL);
00048 static interfMainPanel* getInstance();
00052 static void resetInstance();
00053
00059 void addContourCheckBox(std::string id);
00060
00066 void removeContourCheckBox(std::string id);
00067
00068
00075 void onActionButtonPressed1( wxCommandEvent& event );
00076
00080 void showPanel(wxWindow* panel);
00081
00085 void hidePanel( );
00086
00090 wxPanel* getInfoPanel();
00091
00095 void onCreateContourSpline( );
00096 void onCreateContourRectangle( );
00097 void onCreateContourCircle( );
00098 void onCreateContourLine( );
00099
00100 void onCreateContourPoints( );
00101
00102
00103
00104 void onCreateContourPolygon( );
00105
00106
00107 void onCreateContoursBullEye(wxPanel* panBull);
00109 void onDeleteContour();
00110 void onDeleteContoursActSlice();
00111 void onDeleteAllContours();
00113 void onCopy();
00114 void onPaste();
00115 void onUndo();
00116 void onRedo();
00117
00119 void onLoad();
00120 void onSave();
00121 void onImport();
00122 void onTest();
00124 void RefreshInterface();
00125 vtkImageData* getImageData();
00126 void getImageRange(double[2]);
00127 void onSegmentationOneSlice(int isovalue,int sampling,int method);
00128 void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
00129 int GetImageDataSizeZ();
00130 void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
00131 void onMirrorPressed();
00132 void onMirror();
00133 void onMirrorAxisShow();
00134 void onMirrorAxisHide();
00135 void onMirrorChangeWidth(int width);
00136 void onThresholdPressed();
00137 void onColorLayerImagePressed();
00138 void setLabelSegmentationPanelVTK(wxString tmpString);
00139 void onSegmentationPressed();
00140 void onSegmentationPressedITK();
00141 void onRigidPressed();
00142 void onWidthOfContour(double width);
00143 int getColorWindow();
00144 int getWindowLevel();
00145 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
00146 void onInterpolation(bool interpolate);
00147 void onSpreadPressed();
00148 void onConfigurationPressed();
00149 void resetAppend();
00150 void onSpreadAdd();
00151 void onSpreadAddAll();
00152 void appendStringSpread(std::string val);
00153 void onSpreadGo(int type);
00154 void setStringSpread(std::string stringtemp);
00155 void onInformationPressed();
00156 void getInstantVector(std::vector<int>& tempVector);
00157 std::vector<std::string> getOutlinesName(int slide);
00158 void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ,int grayRangeMin,int grayRangeMax);
00159 void setStringInfoPanel(wxString tmpString);
00160 void setRowLabelInfoPanel(int z, wxString tempString);
00161 int getNumberColsInformationPanel();
00162 void appendColsInformationPanel(int _numberOfVariablesStatistics);
00163 void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
00164 void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
00165 void SetScalarRange(int grayRangeMin,int grayRangeMax);
00166 void onSaveResults(std::string directory,std::string namefile, std::string filename,
00167 int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
00168 wxString getCellValue(int j,int i);
00169 void onSnakePressed();
00170 virtual bool Show(bool show);
00171 void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ);
00172 void SetContourGroup(int contourGroup);
00173
00174
00175
00179 void onPrintLabel();
00180
00181
00187 void onCalibration(wxString size, int unit);
00188
00194 double onePixelSize (double realSize,double sizePixel);
00195
00199 double GetPixelValue();
00200
00201
00202 private:
00203
00204
00205 static interfMainPanel* interfmainpanel;
00206
00207
00208 static wxFrame* _newframe;
00209 wxPanel* menubar;
00210 wxPanel* menubar1;
00211 wxPanel* menubar2;
00212 wxPanel* menubar3;
00213 wxPanel* menubar4;
00214 wxPanel* menubar5;
00215 wxPanel* menubar6;
00216
00217 wxWindow* currentWindow;
00218 wxSplitterWindow* splitterwindow;
00219
00220 wxPanel* infoPanel;
00221 wxPanel* infoPanelMask;
00222
00223
00224
00228 wxPanel* infoPanelCalibration;
00229
00233 wxPanel* panelAux;
00234
00238 double _pixelValue;
00239
00240
00241 wxStaticText* statictext;
00242 wxStaticText* statictext1;
00243 wxStaticText* statictext2;
00244 wxStaticText* statictext3;
00245 wxStaticText* statictext4;
00246 wxStaticText* statictext5;
00247 wxStaticText* statictext6;
00248
00249 std::string PANEL;
00250 std::string PANEL1;
00251 std::string PANEL2;
00252 std::string PANEL3;
00253 std::string PANEL4;
00254 std::string PANEL5;
00255 std::string PANEL6;
00256
00257 wxPanel *segmentPanel;
00258 wxPanel *segmentationPanel;
00259 wxPanel *segmentPanelITK;
00260 wxPanel *configPanel;
00261 wxPanel *spreadPanel;
00262 interfSpreadPanel *panelSpread;
00263 wxWindow *infoWin;
00264 wxPanel *informationPanel;
00265
00266 wxPanel *testPanel;
00267 interfTestPanel *panelTest;
00268
00269 wxPanel *mirrorPanel;
00270 interfMirrorPanel *panelMirror;
00271
00272 wxPanel *thresholdPanel;
00273 wxPanel *colorImageLayerPanel;
00274
00275 bool axisshown;
00276 bool refLineShown;
00277
00278
00279
00280 interfToolsSpreadPanel* toolspread;
00281
00289 wxPanel* initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler);
00290
00294 wxStaticText* getText(wxWindow* parent, std::string nom);
00298 wxButton* getButton(wxWindow* parent);
00302 wxPanel* setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text);
00303
00304
00305 };
00306
00307 #endif
00308