]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/include/wxPathologyWidget_01.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / include / wxPathologyWidget_01.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_PATHOLOGY_WIDGET_01
27 #define WX_PATHOLOGY_WIDGET_01
28 #include <vector>
29
30 #include "vtkImageData.h"
31 #include "vtkActor.h"
32 #include "vtkMarchingCubes.h"
33 #include "vtkPolyDataMapper.h"
34 #include "vtkAppendFilter.h"
35 #include "vtkImageThreshold.h"
36 #include "vtkExtractVOI.h"
37 #include "vtkOutlineFilter.h"
38 #include "vtkImageGaussianSmooth.h"
39 #include "vtkImageCast.h"
40 #include "vtkImageEuclideanDistance.h"
41 #include "vtkPolyDataConnectivityFilter.h"
42 #include "vtkPointSet.h"
43 #include "vtkDataSetMapper.h"
44 #include "vtkImageContinuousDilate3D.h"
45 #include "vtkStripper.h"
46 #include "vtkImageResample.h"
47 #include "vtkPolyDataNormals.h"
48 #include "vtkCellCenters.h"
49 #include "vtkImageEuclideanDistance.h"
50 //#include "vtkSphericalVOI.h"
51
52
53 #include "wxVTKRenderWindowInteractor.h"
54 #include "wxSurfaceWidget.h"
55 #include "wxVtkBaseView.h"
56
57
58 #include "kernel/marInterface.h"
59 #include "kernel/axisExtractor02.h"
60 #include "kernel/vtkSTLExtractor.h"
61 #include "kernel/vtkDijkstraImageData.h"    
62
63
64
65 class wxPathologyWidget_01: public wxPanel{
66 public:
67         wxPathologyWidget_01(wxWindow *parentmar,marInterface *mar);
68         ~wxPathologyWidget_01();
69         void ConfigureVTK();
70         void ConfigureVTK(vtkImageData *imagedata, int x, int y, int z, double param);
71         void Refresh();
72         
73         // --------------------------------------
74         // STL FUNCTIONS DHC
75         // --------------------------------------
76         void ConfigureSTL();
77         void generateSTLSurfaces();
78         void OnBtnFileSTL(wxCommandEvent& event); 
79         void OnBtnLoadBinaryForSTL(wxCommandEvent& event);
80         void OnChangeSTLGaussLevel(wxScrollEvent& event);
81         void OnChangeSTLMarchingCubesLevel(wxScrollEvent& event);
82         void OnOpacitySTLExternal(wxScrollEvent& event);
83         void OnOpacitySTLInternal(wxScrollEvent& event);
84         void OnSTLSubdivisionLevel(wxScrollEvent& event);
85
86         //---------------------------------------
87         // PATHOLOGY FUNCTIONS
88         //---------------------------------------
89         void generatePathologySurface();
90         void OnBtnSetP1(wxCommandEvent& event);
91         void OnBtnSetP2(wxCommandEvent& event);
92         void OnBtnSetPat(wxCommandEvent& event);
93         void OnBtnExtractPat(wxCommandEvent& event);
94         void OnChangePatOpacity(wxScrollEvent& event);
95         void OnChangePatMarchingCubes(wxScrollEvent& event);
96         void OnBtnExtractAxis(wxCommandEvent& event);
97         
98
99 private:
100
101         
102         wxVtk3DBaseView         *_imageviewer3D;
103         wxPanel                         *CreateControlPanel(wxWindow *parent);
104         wxPanel                         *CreateViewPanel(wxWindow *parent);
105
106         //Maracas
107         marInterface            *_mar;
108         wxSurfaceWidget         *_maracasSurfaceWidget;
109
110
111
112         //---------------------
113         // STL SURFACES DHC
114         //---------------------
115         char* workingDir;
116         double stlDeltaGaussLevel;
117         double stlMarchingCubesLevel;
118         int stlSubdivisionLevel;
119
120         vtkImageData * stlImageData;
121         vtkPolyData *stlInterna;
122         vtkPolyData *stlExterna;
123         
124         wxSlider        *stlSliderDeltaGauss;
125         wxSlider        *stlSliderMarchingCubes;
126         wxSlider    *stlSliderSubdivision;
127         
128         vtkPolyDataMapper *dsm1;
129     vtkActor *actorInternal;
130         wxSlider *stlSliderOpacityInternal;
131     
132         vtkPolyDataMapper *dsm2; 
133     vtkActor *actorExternal;
134         wxSlider *stlSliderOpacityExternal;
135
136         vtkSTLExtractor *stlExtractor;
137         
138
139         //------------------------
140         // MPR
141         //------------------------
142         void ConfigureMPR();
143         int px, py, pz;
144         vtkSphereSource                         *mprSphereSource;
145     vtkPolyDataMapper                   *mprMapper;
146     vtkActor                                    *mprActor;
147
148
149
150         //--------------------------
151         // PATHOLOGY
152         //--------------------------
153         void ConfigurePathologyExtraction();
154
155         vtkSphereSource         *p1SphereSource;
156         vtkPolyDataMapper       *p1Mapper;
157         vtkActor                        *p1Actor;
158
159         vtkSphereSource         *p2SphereSource;
160         vtkPolyDataMapper       *p2Mapper;
161         vtkActor                        *p2Actor;
162
163         vtkSphereSource         *patSphereSource;
164         vtkPolyDataMapper       *patMapper;
165         vtkActor                        *patActor;
166
167         vtkOutlineFilter    *outlineFilter;
168         vtkPolyDataMapper   *outlineMapper;
169         vtkActor            *outlineActor;
170
171
172         vtkSphereSource         *p3SphereSource;
173         vtkPolyDataMapper       *p3Mapper;
174         vtkActor                        *p3Actor;
175
176
177         wxFrame                         *pathologyFrame;
178         
179         
180         double p1Center[3];
181         double p2Center[3];
182
183         vtkImageData            *patImageData;
184         vtkImageData            *segImageData;
185         vtkExtractVOI           *voiFilter;
186         
187         vtkMarchingCubes        *cubesFilter;
188         vtkPolyDataMapper       *dataMapper;
189         vtkActor                        *dataActor;
190
191         vtkPolyDataMapper       *caminoMapper;
192         vtkActor                        *caminoActor;
193         
194         wxSlider        *patSliderOpacity;
195         wxSlider        *patSliderMarchingCubes;
196         wxSlider        *patSliderDeltaGauss;
197         double patOpacityLevel;
198         double patMCLevel;
199         double patDeltaGauss;
200         vtkImageGaussianSmooth          *gaussFilter; 
201         vtkImageSeedConnectivity        *connectivityFilter;
202         vtkImageThreshold                       *thresholdFilter;
203         vtkImageCast                            *castFilter;
204         wxSlider        *porcentajeSlider;
205         double thresholdOTSU;
206                 
207
208         vtkDijkstraImageData *dijkstraFilter;
209
210
211         vtkImageContinuousDilate3D *dilateFilter;
212         vtkStripper *stripper;
213         vtkPolyDataConnectivityFilter *polyUnico;
214
215         
216         vtkImageData *isoBinaria;
217         vtkImageEuclideanDistance *isoDistance;
218
219 };
220
221 #endif // WX_PATHOLOGY_WIDGET_01
222
223
224
225