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"
26 #include "wxVtkBaseView_SceneManager.h"
27 #include "wxInstantChooserPanel.h"
28 #include "wxContourViewPanel.h"
30 #include "KernelManagerContour.h"
32 #include "ContourWorkspace.h"
33 #include "contour/contourextractdata.h"
38 #include "PerformingOperation.h"
42 //#include "ContourThing.h"
43 //#include "AxeThing.h"
44 //#include "ImageSourceThing.h"
45 //#include "ImageSectionThing.h"
46 //#include "InstantMembersNameList.h"
47 //#include "OutlineGroup.h"
48 #include "SomeEnvironment.h"
49 #include "ContourWorkspace.h"
50 #include "ContourWrap_ViewControl.h"
52 #include "PerformingOperation.h"
54 #include "ContourThing.h"
56 //#include "OutlineModelManager.h"
58 #include "wxContour_ButtonsBar.h"
59 #include "wxContour_ControlPanel.h"
61 #include "wxContour_Grid.h"
62 #include "wxContour_DrawToolsPanel.h"
63 #include "wxContour_OperationsToolsPanel.h"
64 #include "wxContour_AutomaticFormsToolsPanel.h"
65 #include "wxContour_StandardToolsPanel.h"
66 #include "wxContour_EdtionToolsPanel.h"
67 #include "wxContour_ListViewPanel.h"
72 #include "vtkContourFilter.h"
73 #include "vtkPolyDataConnectivityFilter.h"
74 #include "vtkCleanPolyData.h"
75 #include "vtkImageReslice.h"
76 #include "vtkMetaImageWriter.h"
77 #include "vtkImageData.h"
78 #include "vtkMetaImageReader.h"
80 //------------------------------------------------------------------------------------------------------------
82 //------------------------------------------------------------------------------------------------------------
84 //BEGIN_DECLARE_EVENT_TYPES()
85 //END_DECLARE_EVENT_TYPES()
87 /** file wxContourMainFrame.h */
90 //------------------------------------------------------------------------------------------------------------
92 //------------------------------------------------------------------------------------------------------------
94 class wxContourMainFrame : public wxPanel {
98 //------------------------------------------------------------------------------------------------------------
99 // Constructors & Destructors
100 //------------------------------------------------------------------------------------------------------------
103 wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
104 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);
106 ~wxContourMainFrame();
108 //------------------------------------------------------------------------------------------------------------
109 // Creational and initialization methods
110 //------------------------------------------------------------------------------------------------------------
111 bool configurePanels(wxAuiNotebook * theNoteBook );
113 void setNotebook( wxAuiNotebook * theNoteBook );
115 wxAuiNotebook * createNotebook();
117 void createInstantChooserPanel(wxAuiNotebook * parent);
119 void createViewPanel(wxAuiNotebook * parent);
121 void createInstantChooserPanel(wxWindow * parent);
123 void createViewPanel(wxWindow * parent);
125 void setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel );
127 void setButtonsBar( wxContour_ButtonsBar * theButtonsBar );
129 void setGrid( wxContour_Grid * theGridPanel );
131 void setDrawToolsPanel( wxContour_DrawToolsPanel * theDrawToolsPanel );
133 void setOperationsToolsPanel( wxContour_OperationsToolsPanel * theDrawToolsPanel );
135 void setAutomaticFormsPanel( wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel );
137 void setStandardToolsPanel( wxContour_StandardToolsPanel * theStandardToolsPanel );
139 void setEditionToolsPanel( wxContour_EdtionToolsPanel * theEditionToolsPanel );
141 void setListViewPanel( wxContour_ListViewPanel * theListViewPanel );
144 ////------------------------------------------------------------------------------------------------------------
145 //// Methods for capturing events
146 ////------------------------------------------------------------------------------------------------------------
149 ////------------------------------------------------------------------------------------------------------------
150 //// Model management methods
151 ////------------------------------------------------------------------------------------------------------------
154 //------------------------------------------------------------------------------------------------------------
155 // Attributes getters and setters
156 //------------------------------------------------------------------------------------------------------------
157 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);
158 static wxContourMainFrame* getInstance();
159 //------------------------------------------------------------------------------------------------------------
160 // Other functional methods
161 //------------------------------------------------------------------------------------------------------------
164 ** This method returns the vector of images selected by the user
165 ** return value std::vector<vtkImageData*>
167 std::vector<vtkImageData*> getVectImages();
170 ** This methods connect the event in the class interfMainPanel with the world of the appli
172 void onCreateContourSpline( );
173 void onCreateContourRectangle( );
174 void onCreateContourCircle( );
175 void onCreateContourBullEye(wxPanel* pan);
176 /////////////////////////////////
177 void onDeleteContour();
178 void deleteContours( std::vector<std::string> keyNamesVector );
179 void deleteContour( std::string theKeyName );
180 void onDeleteContoursActSlice();
181 void onDeleteAllContours();
182 void deleteAllContours();
183 void setConceptValue( std::string name, int value );
184 ConceptDataWrap* getLastConceptData();
185 bool getIfConceptCheckedAt( std::string name, int pos );
187 void changeInstant();
189 int getNamesWrappingSize();
191 std::string getNameWrapping(int i);
194 void updateInstantOutlines();
195 void updateInstantImageData();
196 void updateInstantAxes();
198 void onChangeDeep(int val);
200 ///////////////////////////
205 void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
206 ///////////////////////7
210 void openContours( FILE *pFile, bool staticContour );
212 void RefreshInterface();
214 vtkImageData* getImageData();
216 void onSegmentationOneSlice(int isovalue,int sampling,int method);
218 void SegmentationOneSlice( 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);
226 void showAxis(bool show);
228 void onRigidPressed();
230 void onWidthOfContour(double width);
232 int getColorWindow();
233 int getWindowLevel();
235 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
237 void onInterpolation(bool interpolate);
239 void onChangeInstant(std::string name,int actual);
245 void onSpreadGo(int type);
247 void getInstantVector(std::vector<int>& tempVector);
249 std::vector<std::string> getOutlinesName(int slide);
251 void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
253 void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
255 void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
257 void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
259 void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
262 //------------------------------------------------------------------------------------------------------------
264 //------------------------------------------------------------------------------------------------------------
267 //------------------------------------------------------------------------------------------------------------
269 //------------------------------------------------------------------------------------------------------------
270 static wxContourMainFrame* instance;
272 KernelManagerContour* kernelManager;
274 wxContourViewPanel* _theViewPanel;
279 wxArrayString m_perspectives;
280 wxMenu* m_perspectives_menu;
282 long m_notebook_style;
283 long m_notebook_theme;
284 int _numberOfVariablesStatistics;
286 //OutlineModelManager * _modelManager;
288 wxInstantChooserPanel * _instantPanel;
290 wxContour_ButtonsBar * _buttonsBar;
292 wxContour_Grid * _gridPanel;
294 wxContour_DrawToolsPanel * _drawToolsPanel;
296 wxContour_OperationsToolsPanel * _operationsToolsPanel;
298 wxContour_AutomaticFormsToolsPanel * _autoFormsPanel;
300 wxContour_StandardToolsPanel *_standardToolsPanel;
302 wxContour_EdtionToolsPanel * _editionToolsPanel;
304 wxContour_ListViewPanel * _listViewPanel;
306 wxVtkBaseView_SceneManager * _sceneManager;
308 //Instant * _actualInstant;
312 /*DECLARE_CLASS(wxContourMainFrame)
313 // any class wishing to process wxWindows events must use this macro
314 DECLARE_EVENT_TABLE()*/
315 bool _creatingContoursActive;
316 ////////JCP 21 - 11 - 08
317 void createContour( int typeContour );
319 //manualContourModel * factoryManualContourModel(int typeContour);
321 manualContourModel * factoryManualContourModel(wxPanel* panel);
326 void loadState(std::string filename);
328 void saveFileWithContours( std::string filename );
332 std::string stundoredo;
336 //wxContourViewPanel* _viewPan;
337 PerformingOperation* _performingOperation;