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 "vtkTransform.h"
76 //#include "vtkMetaImageReader.h"
78 //------------------------------------------------------------------------------------------------------------
80 //------------------------------------------------------------------------------------------------------------
82 //BEGIN_DECLARE_EVENT_TYPES()
83 //END_DECLARE_EVENT_TYPES()
85 /** file wxContourMainFrame.h */
88 //------------------------------------------------------------------------------------------------------------
90 //------------------------------------------------------------------------------------------------------------
92 class wxContourMainFrame : public wxPanel {
96 //------------------------------------------------------------------------------------------------------------
97 // Constructors & Destructors
98 //------------------------------------------------------------------------------------------------------------
101 wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
102 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>");
104 ~wxContourMainFrame();
106 //------------------------------------------------------------------------------------------------------------
107 // Creational and initialization methods
108 //------------------------------------------------------------------------------------------------------------
109 bool configurePanels(wxAuiNotebook * theNoteBook );
111 void setNotebook( wxAuiNotebook * theNoteBook );
113 wxAuiNotebook * createNotebook();
115 void createInstantChooserPanel(wxAuiNotebook * parent);
117 void createViewPanel(wxAuiNotebook * parent);
119 void createInstantChooserPanel(wxWindow * parent);
121 void createViewPanel(wxWindow * parent);
123 void setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel );
125 // void setButtonsBar( wxContour_ButtonsBar * theButtonsBar );
127 // void setGrid( wxContour_Grid * theGridPanel );
129 // void setDrawToolsPanel( wxContour_DrawToolsPanel * theDrawToolsPanel );
131 // void setOperationsToolsPanel( wxContour_OperationsToolsPanel * theDrawToolsPanel );
133 // void setAutomaticFormsPanel( wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel );
135 // void setStandardToolsPanel( wxContour_StandardToolsPanel * theStandardToolsPanel );
137 // void setEditionToolsPanel( wxContour_EdtionToolsPanel * theEditionToolsPanel );
139 // void setListViewPanel( wxContour_ListViewPanel * theListViewPanel );
142 ////------------------------------------------------------------------------------------------------------------
143 //// Methods for capturing events
144 ////------------------------------------------------------------------------------------------------------------
147 ////------------------------------------------------------------------------------------------------------------
148 //// Model management methods
149 ////------------------------------------------------------------------------------------------------------------
152 //------------------------------------------------------------------------------------------------------------
153 // Attributes getters and setters
154 //------------------------------------------------------------------------------------------------------------
155 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>");
156 static wxContourMainFrame* getInstance();
157 //------------------------------------------------------------------------------------------------------------
158 // Other functional methods
159 //------------------------------------------------------------------------------------------------------------
162 ** This method returns the vector of images selected by the user
163 ** return value std::vector<vtkImageData*>
165 std::vector<vtkImageData*> getVectImages();
168 ** This methods connect the event in the class interfMainPanel with the world of the appli
170 void onCreateContourSpline( );
171 void onCreateContourRectangle( );
172 void onCreateContourCircle( );
173 void onCreateContourLine( );
174 void onCreateContourBullEye(wxPanel* pan);
175 /////////////////////////////////
176 void onDeleteContour();
177 void deleteContours( std::vector<std::string> keyNamesVector );
178 void deleteContour( std::string theKeyName );
179 void onDeleteContoursActSlice();
180 void onDeleteAllContours();
181 void deleteAllContours();
182 void setConceptValue( std::string name, int value );
183 ConceptDataWrap* getLastConceptData();
184 bool getIfConceptCheckedAt( std::string name, int pos );
186 void changeInstant();
188 int getNamesWrappingSize();
190 std::string getNameWrapping(int i);
193 void updateInstantOutlines();
194 void updateInstantImageData();
195 void updateInstantAxes();
197 void onChangeDeep(int val);
199 ///////////////////////////
204 void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
205 void createMirrorContourOf ( 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 void Mirror( int x, int y, int z, int isovalue, int sampling, int method );
222 int GetImageDataSizeZ();
224 void GetImageDataRange(double *range);
226 void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
229 void referenceLine();
236 void showAxis(bool show);
238 void onRigidPressed();
240 void onWidthOfContour(double width);
242 int getColorWindow();
243 int getWindowLevel();
245 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
247 void onInterpolation(bool interpolate);
249 void onChangeInstant(std::string name,int actual);
255 void onSpreadGo(int type);
257 void getInstantVector(std::vector<int>& tempVector);
259 std::vector<std::string> getOutlinesName(int slide);
261 void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
263 void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
265 void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
267 void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
269 void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
271 void onSnakePressed();
273 void saveFileWithContoursAutomatique();
275 //------------------------------------------------------------------------------------------------------------
277 //------------------------------------------------------------------------------------------------------------
280 //------------------------------------------------------------------------------------------------------------
282 //------------------------------------------------------------------------------------------------------------
283 static wxContourMainFrame* instance;
285 KernelManagerContour* kernelManager;
287 wxContourViewPanel* _theViewPanel;
289 wxInstantChooserPanel * _instantPanel;
291 //AD: 03-09: This attributes represents the reference line that is going to be used for the mirroring
292 manualLineControler * _refLineControl;
293 manualContourModelLine * _refLineModel;
294 manualViewLine * _refLineView;
300 wxArrayString m_perspectives;
301 wxMenu* m_perspectives_menu;
303 long m_notebook_style;
304 long m_notebook_theme;
305 int _numberOfVariablesStatistics;
307 //OutlineModelManager * _modelManager;
311 //wxContour_ButtonsBar * _buttonsBar;
313 //wxContour_Grid * _gridPanel;
315 //wxContour_DrawToolsPanel * _drawToolsPanel;
317 //wxContour_OperationsToolsPanel * _operationsToolsPanel;
319 //wxContour_AutomaticFormsToolsPanel * _autoFormsPanel;
321 //wxContour_StandardToolsPanel *_standardToolsPanel;
323 //wxContour_EdtionToolsPanel * _editionToolsPanel;
325 //wxContour_ListViewPanel * _listViewPanel;
327 //wxVtkBaseView_SceneManager * _sceneManager;
329 //Instant * _actualInstant;
333 /*DECLARE_CLASS(wxContourMainFrame)
334 // any class wishing to process wxWindows events must use this macro
335 DECLARE_EVENT_TABLE()*/
336 bool _creatingContoursActive;
337 ////////JCP 21 - 11 - 08
338 void createContour( int typeContour );
340 //manualContourModel * factoryManualContourModel(int typeContour);
342 manualContourModel * factoryManualContourModel(wxPanel* panel);
347 void loadState(std::string filename);
349 void saveFileWithContours( std::string filename );
353 std::string stundoredo;
357 //wxContourViewPanel* _viewPan;
358 PerformingOperation* _performingOperation;