]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/include/wxSTLWidget_02.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / include / wxSTLWidget_02.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #ifndef WX_STL_WIDGET_02
27 #define WX_STL_WIDGET_02
28
29 #include <vector>
30
31 #include <vtkImageData.h>
32 #include <vtkActor.h>
33 #include <vtkMarchingCubes.h>
34 #include <vtkPolyDataMapper.h>
35 #include <vtkAppendFilter.h>
36 #include <vtkImageThreshold.h>
37 #include <vtkExtractVOI.h>
38 #include <vtkOutlineFilter.h>
39 #include <vtkImageSeedConnectivity.h>
40 #include <vtkImageCast.h>
41
42 #include "wxVTKRenderWindowInteractor.h"
43 #include "wxSurfaceWidget.h"
44 #include "wxVtkBaseView.h"
45
46
47 #include "../wxMaracasMPR.h"
48
49 #include <kernel/marInterface.h>
50 #include <kernel/axisExtractor02.h>
51
52
53 #include "kernel/vtkSTLExtractor.h"    
54 #include "kernel/vtkJoiner.h"
55
56
57
58
59 //------------------------------------------------------------------
60 //------------------------------------------------------------------
61 //------------------------------------------------------------------
62
63 class wxSTLWidget_02: public wxPanel{
64 public:
65         wxSTLWidget_02(wxWindow *parentmar,marInterface *mar);
66         ~wxSTLWidget_02();
67         void ConfigureVTK();
68         void Refresh();
69
70         void OnOpacity_Res2VolJF(wxScrollEvent& event);         // Result 2 Volume JF
71
72
73         void OnBtnExtractTree2_JF(wxCommandEvent& event);
74         void OnBtnEraseTree2_JF(wxCommandEvent& event);
75
76         void OnSensibility(wxScrollEvent& event);
77         void OnMaxSphereSize_JF(wxScrollEvent& event);          // radio Max
78         void OnMinSphereSize_JF(wxScrollEvent& event);          // radio Min
79
80         //
81         void Reset_vtk_STLFile();
82         void OnBtnSTLFileLoad(wxCommandEvent& event);
83         void OnBtnSTLFileErase(wxCommandEvent& event);
84         void OnOpacitySTLFile(wxScrollEvent& event);            
85
86
87         // --------------------------------------
88         // STL FUNCTIONS DHC
89         // --------------------------------------
90         void generateSTLSurfaces();
91         void OnBtnCreateFileSTL(wxCommandEvent& event); 
92         void OnChangeSTLGaussLevel(wxScrollEvent& event);
93         void OnChangeSTLMarchingCubesLevel(wxScrollEvent& event);
94         void OnOpacitySTLExternal(wxScrollEvent& event);
95         void OnOpacitySTLInternal(wxScrollEvent& event);
96
97         //---------------------------------------
98         // JOIN REGIONS FUNCTIONS
99         //---------------------------------------
100         void OnJoinRegions(wxCommandEvent& event);
101
102 private:
103
104
105         // Result 1 volume + Axis   
106 //      vtkPolyDataMapper       *_1_mapfinal;
107 //      vtkActor                        *_1_stripfinal;
108 //      vtkPolyDataMapper       *_1_isoMapperMC6;
109 //      vtkActor                        *_1_isoActorMC6;
110 //      vtkMarchingCubes        *_1_isoMC6;
111
112         // Result 2 volume + Axis   
113         axisExtractor02         *_2_prgov;
114         vtkPolyDataMapper       *_2_mapfinal;
115         vtkActor                        *_2_stripfinal;
116         vtkPolyDataMapper       *_2_isoMapperMC6;
117         vtkActor                        *_2_isoActorMC6;
118         vtkMarchingCubes        *_2_isoMC6;
119         double                          _sensibility_JF;
120         int                                     _maxSphereSize_JF;
121         int                                     _minSphereSize_JF;
122
123         // Load STL file
124         vtkPolyDataMapper *_loadSTLMapper;
125         vtkActor                  *_loadActorSTL;
126
127
128         wxSlider                        *_opacity_Res2VolJF;
129         wxSlider                        *_sl_sensibility_JF;
130         wxSlider                        *_sl_maxSphereSize_JF;
131         wxSlider                        *_sl_minSphereSize_JF;
132         
133         wxVtk3DBaseView         *_imageviewer3D;
134         wxPanel                         *CreateControlPanel(wxWindow *parent);
135         wxPanel                         *CreateViewPanel(wxWindow *parent);
136
137         //Maracas
138         marInterface            *_mar;
139         wxMaracasMPR            *_wxMaracasMPR;
140
141         void ResetTree2_JF();
142         void ExtractTree2_JF(int x, int y, int z);
143
144
145
146         //---------------------
147         // STL SURFACES DHC
148         //---------------------
149         void            ConfigureSTL();
150         double          _stlDeltaGaussLevel;
151         double          _stlMarchingCubesLevel;
152
153         
154         vtkPolyData *stlInterna;
155         vtkPolyData *stlExterna;
156         
157         wxSlider        *stlSliderDeltaGauss;
158         wxSlider        *stlSliderMarchingCubes;
159         
160         vtkPolyDataMapper *dsm1;
161     vtkActor    *actorInternal;
162         wxSlider        *stlSliderOpacityInternal;
163     
164         vtkPolyDataMapper *dsm2; 
165     vtkActor    *actorExternal;
166         wxSlider        *stlSliderOpacityExternal;
167
168         vtkSTLExtractor *stlExtractor;   
169
170         wxSlider        *_sl_opacity_STL_file;
171
172
173
174         //--------------------------
175         // JOIN REGIONS
176         //--------------------------
177         void ConfigureJoinRegions();
178
179         vtkImageData            *arteryImageData;
180         vtkJoiner                       *joiner;
181         vtkMarchingCubes        *joinMarchingCubes;
182     vtkPolyDataMapper   *joinMapper; 
183         vtkActor                        *joinActor; 
184
185 };
186
187 #endif // WX_STL_WIDGET_02
188
189
190
191