]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/include/Copie de wxSTLWidget_03.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / include / Copie de wxSTLWidget_03.h
1
2 #ifndef WX_STL_WIDGET_03
3 #define WX_STL_WIDGET_03
4
5 #include <vector>
6
7 #include <vtkImageData.h>
8 #include <vtkActor.h>
9 #include <vtkMarchingCubes.h>
10 #include <vtkPolyDataMapper.h>
11 #include <vtkAppendFilter.h>
12 #include <vtkImageThreshold.h>
13 #include <vtkExtractVOI.h>
14 #include <vtkOutlineFilter.h>
15 #include <vtkImageSeedConnectivity.h>
16 #include <vtkImageCast.h>
17
18 #include "wxVTKRenderWindowInteractor.h"
19 #include "wxSurfaceWidget.h"
20 #include "wxVtkBaseView.h"
21
22
23 #include "../wxMaracasMPR.h"
24 #include "pPlotter/mBarRange.h"//SIL//
25
26 #include <kernel/marInterface.h>
27 #include <kernel/axisExtractor02.h>
28
29
30 #include "kernel/vtkSTLExtractor.h"    
31 #include "kernel/vtkJoiner.h"
32
33
34
35
36 //------------------------------------------------------------------
37 //------------------------------------------------------------------
38 //------------------------------------------------------------------
39
40 class wxSTLWidget_03: public wxPanel{
41 public:
42         wxSTLWidget_03(wxWindow *parentmar,marInterface *mar);
43         ~wxSTLWidget_03();
44         void ConfigureVTK();
45         void Refresh();
46
47         void OnOpacity_Vol(wxScrollEvent& event);               // Result Volume 
48         void OnMinSpin ( wxScrollEvent & event );
49         void OnMaxSpin ( wxScrollEvent & event ); 
50
51         //SIL new// 
52         void OnRangeSpin( wxScrollEvent & event );
53
54         //Handled events form the bar
55         void OnStartChanged_range(wxCommandEvent& event);
56         void OnEndChanged_range(wxCommandEvent& event);
57         void OnBarMoved_range(wxCommandEvent& event);
58
59
60         void OnBtnExtraction(wxCommandEvent& event);
61         void OnBtnSaveBinaryFile(wxCommandEvent& event);
62
63         //
64         void Reset_vtk_STLFile();
65         void OnBtnSTLFileLoad(wxCommandEvent& event);
66         void OnBtnSTLFileErase(wxCommandEvent& event);
67         void OnOpacitySTLFile(wxScrollEvent& event);            
68
69
70         // --------------------------------------
71         // STL FUNCTIONS DHC
72         // --------------------------------------
73         void generateSTLSurfaces();
74         void OnBtnCreateFileSTL(wxCommandEvent& event); 
75         void OnChangeSTLGaussLevel(wxScrollEvent& event);
76         void OnChangeSTLMarchingCubesLevel(wxScrollEvent& event);
77         void OnOpacitySTLExternal(wxScrollEvent& event);
78         void OnOpacitySTLInternal(wxScrollEvent& event);
79
80         
81         //---------------------------------------
82         // JOIN REGIONS FUNCTIONS
83         //---------------------------------------
84         void OnJoinRegions(wxCommandEvent& event);
85
86 private:
87
88         //Processing
89         vtkImageData                            *_imagedata;
90         double                                          _range[2];
91         vtkImageCast                            *cast2;
92         vtkImageCast                            *cast3;
93         vtkImageCast                            *cast4; // binary segmentation result
94         vtkImageThreshold                       *_thresh;
95         vtkImageThreshold                       *_thresh2;
96         vtkImageSeedConnectivity        *_connect;
97         vtkImageSeedConnectivity        *_connect2;
98
99
100
101         vtkPolyDataMapper       *_2_mapfinal;
102         vtkActor                        *_2_stripfinal;
103         vtkPolyDataMapper       *_2_isoMapperMC6;
104         vtkActor                        *_2_isoActorMC6;
105         vtkMarchingCubes        *_2_isoMC6;
106         double                          _sensibility_JF;
107         int                                     _maxSize;
108         int                                     _minSize;
109
110         // Load STL file
111         vtkPolyDataMapper *_loadSTLMapper;
112         vtkActor                  *_loadActorSTL;
113
114
115         wxSlider                        *_opacity_Vol;
116         wxSlider                        *_sl_minSize;
117         wxSlider                        *_sl_maxSize;
118         wxSlider                        *_sl_minSizeSpin;
119         wxSlider                        *_sl_maxSizeSpin;
120         wxSlider                        *_sl_RangeSizeSpin;
121
122         
123         /*
124         * Represents the bar of min and max for merging the functionality of two sliders for controlling the segmentation parameters
125         */
126         mBarRange                       * sl_barrange_segmentation;
127         int                                     lastResizeRef_Value;
128         int                                     minRangeValue;
129         int                                     maxRangeValue;
130         
131         wxVtk3DBaseView         *_imageviewer3D;
132         wxPanel                         *CreateControlPanel(wxWindow *parent);
133         wxPanel                         *CreateViewPanel(wxWindow *parent);
134
135         //Maracas
136         marInterface            *_mar;
137         wxMaracasMPR            *_wxMaracasMPR;
138
139         void ResetTree2_JF();
140         void ExtractSurface(int x, int y, int z);
141
142         wxWindow* CreateSelectAPointPanel(wxWindow *parent);
143         wxWindow* CreateSegmentationPanel(wxWindow *parent);
144         wxWindow* CreateSmoothingPanel(wxWindow *parent);
145         wxWindow* CreateReadSTLFilePanel(wxWindow *parent);
146
147         //---------------------
148         // Processing
149         //---------------------
150         void ConfigureProcessing(marImageData *marimagedata, int x, int y, int z);
151
152
153         //---------------------
154         // STL SURFACES DHC
155         //---------------------
156         void            ConfigureSTL();
157         double          _stlDeltaGaussLevel;
158         double          _stlMarchingCubesLevel;
159
160         
161         vtkPolyData *stlInterna;
162         vtkPolyData *stlExterna;
163         
164         wxSlider        *stlSliderDeltaGauss;
165         wxSlider        *stlSliderMarchingCubes;
166         
167         vtkPolyDataMapper *dsm1;
168     vtkActor    *actorInternal;
169         wxSlider        *stlSliderOpacityInternal;
170     
171         vtkPolyDataMapper *dsm2; 
172     vtkActor    *actorExternal;
173         wxSlider        *stlSliderOpacityExternal;
174
175         vtkSTLExtractor *stlExtractor;   
176
177         wxSlider        *_sl_opacity_STL_file;
178
179
180
181         //--------------------------
182         // JOIN REGIONS
183         //--------------------------
184
185         vtkImageData            *arteryImageData;
186         vtkJoiner                       *joiner;
187         vtkMarchingCubes        *joinMarchingCubes;
188     vtkPolyDataMapper   *joinMapper; 
189         vtkActor                        *joinActor; 
190
191 };
192
193 #endif // WX_STL_WIDGET_03
194
195
196
197