1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 #ifndef WX_PATHOLOGY_WIDGET_01
27 #define WX_PATHOLOGY_WIDGET_01
30 #include "vtkImageData.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"
53 #include "wxVTKRenderWindowInteractor.h"
54 #include "wxSurfaceWidget.h"
55 #include "wxVtkBaseView.h"
58 #include "kernel/marInterface.h"
59 #include "kernel/axisExtractor02.h"
60 #include "kernel/vtkSTLExtractor.h"
61 #include "kernel/vtkDijkstraImageData.h"
65 class wxPathologyWidget_01: public wxPanel{
67 wxPathologyWidget_01(wxWindow *parentmar,marInterface *mar);
68 ~wxPathologyWidget_01();
70 void ConfigureVTK(vtkImageData *imagedata, int x, int y, int z, double param);
73 // --------------------------------------
75 // --------------------------------------
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);
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);
102 wxVtk3DBaseView *_imageviewer3D;
103 wxPanel *CreateControlPanel(wxWindow *parent);
104 wxPanel *CreateViewPanel(wxWindow *parent);
108 wxSurfaceWidget *_maracasSurfaceWidget;
112 //---------------------
114 //---------------------
116 double stlDeltaGaussLevel;
117 double stlMarchingCubesLevel;
118 int stlSubdivisionLevel;
120 vtkImageData * stlImageData;
121 vtkPolyData *stlInterna;
122 vtkPolyData *stlExterna;
124 wxSlider *stlSliderDeltaGauss;
125 wxSlider *stlSliderMarchingCubes;
126 wxSlider *stlSliderSubdivision;
128 vtkPolyDataMapper *dsm1;
129 vtkActor *actorInternal;
130 wxSlider *stlSliderOpacityInternal;
132 vtkPolyDataMapper *dsm2;
133 vtkActor *actorExternal;
134 wxSlider *stlSliderOpacityExternal;
136 vtkSTLExtractor *stlExtractor;
139 //------------------------
141 //------------------------
144 vtkSphereSource *mprSphereSource;
145 vtkPolyDataMapper *mprMapper;
150 //--------------------------
152 //--------------------------
153 void ConfigurePathologyExtraction();
155 vtkSphereSource *p1SphereSource;
156 vtkPolyDataMapper *p1Mapper;
159 vtkSphereSource *p2SphereSource;
160 vtkPolyDataMapper *p2Mapper;
163 vtkSphereSource *patSphereSource;
164 vtkPolyDataMapper *patMapper;
167 vtkOutlineFilter *outlineFilter;
168 vtkPolyDataMapper *outlineMapper;
169 vtkActor *outlineActor;
172 vtkSphereSource *p3SphereSource;
173 vtkPolyDataMapper *p3Mapper;
177 wxFrame *pathologyFrame;
183 vtkImageData *patImageData;
184 vtkImageData *segImageData;
185 vtkExtractVOI *voiFilter;
187 vtkMarchingCubes *cubesFilter;
188 vtkPolyDataMapper *dataMapper;
191 vtkPolyDataMapper *caminoMapper;
192 vtkActor *caminoActor;
194 wxSlider *patSliderOpacity;
195 wxSlider *patSliderMarchingCubes;
196 wxSlider *patSliderDeltaGauss;
197 double patOpacityLevel;
199 double patDeltaGauss;
200 vtkImageGaussianSmooth *gaussFilter;
201 vtkImageSeedConnectivity *connectivityFilter;
202 vtkImageThreshold *thresholdFilter;
203 vtkImageCast *castFilter;
204 wxSlider *porcentajeSlider;
205 double thresholdOTSU;
208 vtkDijkstraImageData *dijkstraFilter;
211 vtkImageContinuousDilate3D *dilateFilter;
212 vtkStripper *stripper;
213 vtkPolyDataConnectivityFilter *polyUnico;
216 vtkImageData *isoBinaria;
217 vtkImageEuclideanDistance *isoDistance;
221 #endif // WX_PATHOLOGY_WIDGET_01