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 "itkGeodesicActiveContourLevelSetImageFilter.h"
71 #include "itkCurvatureAnisotropicDiffusionImageFilter.h"
72 #include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
73 #include "itkSigmoidImageFilter.h"
74 #include "itkFastMarchingImageFilter.h"
75 #include "itkRescaleIntensityImageFilter.h"
76 #include "itkBinaryThresholdImageFilter.h"
77 #include "itkZeroCrossingImageFilter.h"
78 #include "itkCastImageFilter.h"
80 #include "itkImageFileWriter.h"
82 #include "itkImageToVTKImageFilter.h"
83 #include "itkVTKImageToImageFilter.h"
86 #include <vtkImageSeedConnectivity.h>
87 #include <vtkImageMarchingCubes.h>
88 #include "vtkContourFilter.h"
89 #include "vtkMarchingContourFilter.h"
90 #include "vtkPolyDataConnectivityFilter.h"
91 #include "vtkCleanPolyData.h"
92 #include "vtkImageReslice.h"
93 #include "vtkMetaImageWriter.h"
94 #include "vtkImageData.h"
95 #include "vtkTransform.h"
96 //#include "vtkMetaImageReader.h"
98 //------------------------------------------------------------------------------------------------------------
100 //------------------------------------------------------------------------------------------------------------
102 //BEGIN_DECLARE_EVENT_TYPES()
103 //END_DECLARE_EVENT_TYPES()
105 /** file wxContourMainFrame.h */
108 //------------------------------------------------------------------------------------------------------------
110 //------------------------------------------------------------------------------------------------------------
112 class wxContourMainFrame : public wxPanel {
116 //------------------------------------------------------------------------------------------------------------
117 // Constructors & Destructors
118 //------------------------------------------------------------------------------------------------------------
121 wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
122 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>");
124 ~wxContourMainFrame();
126 //------------------------------------------------------------------------------------------------------------
127 // Creational and initialization methods
128 //------------------------------------------------------------------------------------------------------------
129 bool configurePanels(wxAuiNotebook * theNoteBook );
131 void setNotebook( wxAuiNotebook * theNoteBook );
133 wxAuiNotebook * createNotebook();
135 void createInstantChooserPanel(wxAuiNotebook * parent);
137 void createViewPanel(wxAuiNotebook * parent);
139 void createInstantChooserPanel(wxWindow * parent);
141 void createViewPanel(wxWindow * parent);
143 void setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel );
145 // void setButtonsBar( wxContour_ButtonsBar * theButtonsBar );
147 // void setGrid( wxContour_Grid * theGridPanel );
149 // void setDrawToolsPanel( wxContour_DrawToolsPanel * theDrawToolsPanel );
151 // void setOperationsToolsPanel( wxContour_OperationsToolsPanel * theDrawToolsPanel );
153 // void setAutomaticFormsPanel( wxContour_AutomaticFormsToolsPanel * theAutoFormsPanel );
155 // void setStandardToolsPanel( wxContour_StandardToolsPanel * theStandardToolsPanel );
157 // void setEditionToolsPanel( wxContour_EdtionToolsPanel * theEditionToolsPanel );
159 // void setListViewPanel( wxContour_ListViewPanel * theListViewPanel );
162 ////------------------------------------------------------------------------------------------------------------
163 //// Methods for capturing events
164 ////------------------------------------------------------------------------------------------------------------
167 ////------------------------------------------------------------------------------------------------------------
168 //// Model management methods
169 ////------------------------------------------------------------------------------------------------------------
172 //------------------------------------------------------------------------------------------------------------
173 // Attributes getters and setters
174 //------------------------------------------------------------------------------------------------------------
175 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>");
176 static wxContourMainFrame* getInstance();
177 //------------------------------------------------------------------------------------------------------------
178 // Other functional methods
179 //------------------------------------------------------------------------------------------------------------
182 ** This method returns the vector of images selected by the user
183 ** return value std::vector<vtkImageData*>
185 std::vector<vtkImageData*> getVectImages();
188 ** This methods connect the event in the class interfMainPanel with the world of the appli
190 void onCreateContourSpline( );
191 void onCreateContourRectangle( );
192 void onCreateContourCircle( );
193 void onCreateContourLine( );
194 void onCreateContourBullEye(wxPanel* pan);
195 /////////////////////////////////
196 void onDeleteContour();
197 void deleteContours( std::vector<std::string> keyNamesVector );
198 void deleteContour( std::string theKeyName );
199 void onDeleteContoursActSlice();
200 void onDeleteAllContours();
201 void deleteAllContours();
202 void setConceptValue( std::string name, int value );
203 ConceptDataWrap* getLastConceptData();
204 bool getIfConceptCheckedAt( std::string name, int pos );
206 void changeInstant();
208 int getNamesWrappingSize();
210 std::string getNameWrapping(int i);
213 void updateInstantOutlines();
214 void updateInstantImageData();
215 void updateInstantAxes();
217 void onChangeDeep(int val);
219 ///////////////////////////
224 void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
225 void createMirrorContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
226 ///////////////////////7
230 void openContours( FILE *pFile, bool staticContour );
232 void RefreshInterface();
234 vtkImageData* getImageData();
236 void onSegmentationOneSlice(int isovalue,int sampling,int method);
238 void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
240 void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
242 void SegmentationOneSliceITK(int x, int y, int z, wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
244 void Mirror( int x, int y, int z, int isovalue, int sampling, int method );
246 int GetImageDataSizeZ();
248 void GetImageDataRange(double *range);
250 void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
253 void referenceLine();
260 void showAxis(bool show);
262 void onRigidPressed();
264 void onWidthOfContour(double width);
266 int getColorWindow();
267 int getWindowLevel();
269 void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
271 void onInterpolation(bool interpolate);
273 void onChangeInstant(std::string name,int actual);
279 void onSpreadGo(int type);
281 void getInstantVector(std::vector<int>& tempVector);
283 std::vector<std::string> getOutlinesName(int slide);
285 void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
287 void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
289 void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
291 void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
293 void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
295 void onSnakePressed();
297 void saveFileWithContoursAutomatique();
299 //------------------------------------------------------------------------------------------------------------
301 //------------------------------------------------------------------------------------------------------------
304 //------------------------------------------------------------------------------------------------------------
306 //------------------------------------------------------------------------------------------------------------
307 static wxContourMainFrame* instance;
309 KernelManagerContour* kernelManager;
311 wxContourViewPanel* _theViewPanel;
313 wxInstantChooserPanel * _instantPanel;
315 //AD: 03-09: This attributes represents the reference line that is going to be used for the mirroring
316 manualLineControler * _refLineControl;
317 manualContourModelLine * _refLineModel;
318 manualViewLine * _refLineView;
324 wxArrayString m_perspectives;
325 wxMenu* m_perspectives_menu;
327 long m_notebook_style;
328 long m_notebook_theme;
329 int _numberOfVariablesStatistics;
331 //OutlineModelManager * _modelManager;
335 //wxContour_ButtonsBar * _buttonsBar;
337 //wxContour_Grid * _gridPanel;
339 //wxContour_DrawToolsPanel * _drawToolsPanel;
341 //wxContour_OperationsToolsPanel * _operationsToolsPanel;
343 //wxContour_AutomaticFormsToolsPanel * _autoFormsPanel;
345 //wxContour_StandardToolsPanel *_standardToolsPanel;
347 //wxContour_EdtionToolsPanel * _editionToolsPanel;
349 //wxContour_ListViewPanel * _listViewPanel;
351 //wxVtkBaseView_SceneManager * _sceneManager;
353 //Instant * _actualInstant;
357 /*DECLARE_CLASS(wxContourMainFrame)
358 // any class wishing to process wxWindows events must use this macro
359 DECLARE_EVENT_TABLE()*/
360 bool _creatingContoursActive;
361 ////////JCP 21 - 11 - 08
362 void createContour( int typeContour );
364 //manualContourModel * factoryManualContourModel(int typeContour);
366 manualContourModel * factoryManualContourModel(wxPanel* panel);
371 void loadState(std::string filename);
373 void saveFileWithContours( std::string filename );
377 std::string stundoredo;
381 //wxContourViewPanel* _viewPan;
382 PerformingOperation* _performingOperation;