1 #ifndef __wxContourMainFrame_h_INCLUDED_H__
2 #define __wxContourMainFrame_h_INCLUDED_H__
5 // -----------------------------------------------------------------------------------------------------------
6 // WX headers inclusion.
7 // For compilers that support precompilation, includes <wx/wx.h>.
8 // -----------------------------------------------------------------------------------------------------------
10 #include <wx/wxprec.h>
19 //------------------------------------------------------------------------------------------------------------
21 //------------------------------------------------------------------------------------------------------------
22 #include "wx/aui/aui.h"
24 #include "interfMainPanel.h"
25 #include "KernelManagerContour.h"
27 //#include "wxVtkBaseView_SceneManager.h"
28 #include "wxInstantChooserPanel.h"
29 #include "wxContourViewPanel.h"
33 //#include "ContourWorkspace.h"
34 #include "ContourExtractData.h"
35 #include "PerformingOperation.h"
39 //#include "ContourThing.h"
40 //#include "AxeThing.h"
41 //#include "ImageSourceThing.h"
42 //#include "ImageSectionThing.h"
43 //#include "InstantMembersNameList.h"
44 //#include "OutlineGroup.h"
45 //#include "SomeEnvironment.h"
46 //#include "ContourWorkspace.h"
47 //#include "ContourWrap_ViewControl.h"
48 //#include "Instant.h"
49 //#include "PerformingOperation.h"
51 //#include "ContourThing.h"
53 //#include "OutlineModelManager.h"
55 //#include "wxContour_ButtonsBar.h"
56 //#include "wxContour_ControlPanel.h"
58 //#include "wxContour_Grid.h"
59 //#include "wxContour_DrawToolsPanel.h"
60 //#include "wxContour_OperationsToolsPanel.h"
61 //#include "wxContour_AutomaticFormsToolsPanel.h"
62 //#include "wxContour_StandardToolsPanel.h"
63 //#include "wxContour_EdtionToolsPanel.h"
64 //#include "wxContour_ListViewPanel.h"
69 #include "vtkContourFilter.h"
70 #include "vtkPolyDataConnectivityFilter.h"
71 #include "vtkCleanPolyData.h"
72 #include "vtkImageReslice.h"
73 #include "vtkMetaImageWriter.h"
74 #include "vtkImageData.h"
75 //#include "vtkMetaImageReader.h"
77 //------------------------------------------------------------------------------------------------------------
79 //------------------------------------------------------------------------------------------------------------
81 //BEGIN_DECLARE_EVENT_TYPES()
82 //END_DECLARE_EVENT_TYPES()
84 /** file wxContourMainFrame.h */
87 //------------------------------------------------------------------------------------------------------------
89 //------------------------------------------------------------------------------------------------------------
91 class wxContourMainFrame : public wxPanel {
95 //------------------------------------------------------------------------------------------------------------
96 // Constructors & Destructors
97 //------------------------------------------------------------------------------------------------------------
100 wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
101 wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,std::string datadir="<void>");
103 ~wxContourMainFrame();
105 //------------------------------------------------------------------------------------------------------------
106 // Creational and initialization methods
107 //------------------------------------------------------------------------------------------------------------
108 bool configurePanels(wxAuiNotebook * theNoteBook );
110 void setNotebook( wxAuiNotebook * theNoteBook );
112 wxAuiNotebook * createNotebook();
114 void createInstantChooserPanel(wxAuiNotebook * parent);
116 void createViewPanel(wxAuiNotebook * parent);
118 void createInstantChooserPanel(wxWindow * parent);
120 void createViewPanel(wxWindow * parent);
122 void setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel );
124 // void setButtonsBar( wxContour_ButtonsBar * theButtonsBar );
126 // void setGrid( wxContour_Grid * theGridPanel );
128 // void setDrawToolsPanel( wxContour_DrawToolsPanel * theDrawToolsPanel );
130 // void setOperationsToolsPanel( wxContour_OperationsToolsPanel * theDrawToolsPanel );
132 // void setAutomaticFormsPanel( wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel );
134 // void setStandardToolsPanel( wxContour_StandardToolsPanel * theStandardToolsPanel );
136 // void setEditionToolsPanel( wxContour_EdtionToolsPanel * theEditionToolsPanel );
138 // void setListViewPanel( wxContour_ListViewPanel * theListViewPanel );
141 ////------------------------------------------------------------------------------------------------------------
142 //// Methods for capturing events
143 ////------------------------------------------------------------------------------------------------------------
146 ////------------------------------------------------------------------------------------------------------------
147 //// Model management methods
148 ////------------------------------------------------------------------------------------------------------------
151 //------------------------------------------------------------------------------------------------------------
152 // Attributes getters and setters
153 //------------------------------------------------------------------------------------------------------------
154 static wxContourMainFrame* getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, std::string datadir="<void>");
155 static wxContourMainFrame* getInstance();
156 //------------------------------------------------------------------------------------------------------------
157 // Other functional methods
158 //------------------------------------------------------------------------------------------------------------
161 ** This method returns the vector of images selected by the user
162 ** return value std::vector<vtkImageData*>
164 std::vector<vtkImageData*> getVectImages();
167 ** This methods connect the event in the class interfMainPanel with the world of the appli
169 void onCreateContourSpline( );
170 void onCreateContourRectangle( );
171 void onCreateContourCircle( );
172 void onCreateContourLine( );
173 void onCreateContourBullEye(wxPanel* pan);
174 /////////////////////////////////
175 void onDeleteContour();
176 void deleteContours( std::vector<std::string> keyNamesVector );
177 void deleteContour( std::string theKeyName );
178 void onDeleteContoursActSlice();
179 void onDeleteAllContours();
180 void deleteAllContours();
181 void setConceptValue( std::string name, int value );
182 ConceptDataWrap* getLastConceptData();
183 bool getIfConceptCheckedAt( std::string name, int pos );
185 void changeInstant();
187 int getNamesWrappingSize();
189 std::string getNameWrapping(int i);
192 void updateInstantOutlines();
193 void updateInstantImageData();
194 void updateInstantAxes();
196 void onChangeDeep(int val);
198 ///////////////////////////
203 void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
204 ///////////////////////7
208 void openContours( FILE *pFile, bool staticContour );
210 void RefreshInterface();
212 vtkImageData* getImageData();
214 void onSegmentationOneSlice(int isovalue,int sampling,int method);
216 void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
218 void Mirror( int x, int y, int z, int isovalue, int sampling, int method );
220 int GetImageDataSizeZ();
222 void GetImageDataRange(double *range);
224 void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
228 void showAxis(bool show);
230 void onRigidPressed();
232 void onWidthOfContour(double width);
234 int getColorWindow();
235 int getWindowLevel();
237 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
239 void onInterpolation(bool interpolate);
241 void onChangeInstant(std::string name,int actual);
247 void onSpreadGo(int type);
249 void getInstantVector(std::vector<int>& tempVector);
251 std::vector<std::string> getOutlinesName(int slide);
253 void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
255 void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
257 void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
259 void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
261 void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
263 void onSnakePressed();
265 void saveFileWithContoursAutomatique();
267 //------------------------------------------------------------------------------------------------------------
269 //------------------------------------------------------------------------------------------------------------
272 //------------------------------------------------------------------------------------------------------------
274 //------------------------------------------------------------------------------------------------------------
275 static wxContourMainFrame* instance;
277 KernelManagerContour* kernelManager;
279 wxContourViewPanel* _theViewPanel;
281 wxInstantChooserPanel * _instantPanel;
286 wxArrayString m_perspectives;
287 wxMenu* m_perspectives_menu;
289 long m_notebook_style;
290 long m_notebook_theme;
291 int _numberOfVariablesStatistics;
293 //OutlineModelManager * _modelManager;
297 //wxContour_ButtonsBar * _buttonsBar;
299 //wxContour_Grid * _gridPanel;
301 //wxContour_DrawToolsPanel * _drawToolsPanel;
303 //wxContour_OperationsToolsPanel * _operationsToolsPanel;
305 //wxContour_AutomaticFormsToolsPanel * _autoFormsPanel;
307 //wxContour_StandardToolsPanel *_standardToolsPanel;
309 //wxContour_EdtionToolsPanel * _editionToolsPanel;
311 //wxContour_ListViewPanel * _listViewPanel;
313 //wxVtkBaseView_SceneManager * _sceneManager;
315 //Instant * _actualInstant;
319 /*DECLARE_CLASS(wxContourMainFrame)
320 // any class wishing to process wxWindows events must use this macro
321 DECLARE_EVENT_TABLE()*/
322 bool _creatingContoursActive;
323 ////////JCP 21 - 11 - 08
324 void createContour( int typeContour );
326 //manualContourModel * factoryManualContourModel(int typeContour);
328 manualContourModel * factoryManualContourModel(wxPanel* panel);
333 void loadState(std::string filename);
335 void saveFileWithContours( std::string filename );
339 std::string stundoredo;
343 //wxContourViewPanel* _viewPan;
344 PerformingOperation* _performingOperation;