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_STL_WIDGET_02
27 #define WX_STL_WIDGET_02
31 #include <vtkImageData.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>
42 #include "wxVTKRenderWindowInteractor.h"
43 #include "wxSurfaceWidget.h"
44 #include "wxVtkBaseView.h"
47 #include "../wxMaracasMPR.h"
49 #include <kernel/marInterface.h>
50 #include <kernel/axisExtractor02.h>
53 #include "kernel/vtkSTLExtractor.h"
54 #include "kernel/vtkJoiner.h"
59 //------------------------------------------------------------------
60 //------------------------------------------------------------------
61 //------------------------------------------------------------------
63 class wxSTLWidget_02: public wxPanel{
65 wxSTLWidget_02(wxWindow *parentmar,marInterface *mar);
70 void OnOpacity_Res2VolJF(wxScrollEvent& event); // Result 2 Volume JF
73 void OnBtnExtractTree2_JF(wxCommandEvent& event);
74 void OnBtnEraseTree2_JF(wxCommandEvent& event);
76 void OnSensibility(wxScrollEvent& event);
77 void OnMaxSphereSize_JF(wxScrollEvent& event); // radio Max
78 void OnMinSphereSize_JF(wxScrollEvent& event); // radio Min
81 void Reset_vtk_STLFile();
82 void OnBtnSTLFileLoad(wxCommandEvent& event);
83 void OnBtnSTLFileErase(wxCommandEvent& event);
84 void OnOpacitySTLFile(wxScrollEvent& event);
87 // --------------------------------------
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);
97 //---------------------------------------
98 // JOIN REGIONS FUNCTIONS
99 //---------------------------------------
100 void OnJoinRegions(wxCommandEvent& event);
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;
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;
124 vtkPolyDataMapper *_loadSTLMapper;
125 vtkActor *_loadActorSTL;
128 wxSlider *_opacity_Res2VolJF;
129 wxSlider *_sl_sensibility_JF;
130 wxSlider *_sl_maxSphereSize_JF;
131 wxSlider *_sl_minSphereSize_JF;
133 wxVtk3DBaseView *_imageviewer3D;
134 wxPanel *CreateControlPanel(wxWindow *parent);
135 wxPanel *CreateViewPanel(wxWindow *parent);
139 wxMaracasMPR *_wxMaracasMPR;
141 void ResetTree2_JF();
142 void ExtractTree2_JF(int x, int y, int z);
146 //---------------------
148 //---------------------
150 double _stlDeltaGaussLevel;
151 double _stlMarchingCubesLevel;
154 vtkPolyData *stlInterna;
155 vtkPolyData *stlExterna;
157 wxSlider *stlSliderDeltaGauss;
158 wxSlider *stlSliderMarchingCubes;
160 vtkPolyDataMapper *dsm1;
161 vtkActor *actorInternal;
162 wxSlider *stlSliderOpacityInternal;
164 vtkPolyDataMapper *dsm2;
165 vtkActor *actorExternal;
166 wxSlider *stlSliderOpacityExternal;
168 vtkSTLExtractor *stlExtractor;
170 wxSlider *_sl_opacity_STL_file;
174 //--------------------------
176 //--------------------------
177 void ConfigureJoinRegions();
179 vtkImageData *arteryImageData;
181 vtkMarchingCubes *joinMarchingCubes;
182 vtkPolyDataMapper *joinMapper;
187 #endif // WX_STL_WIDGET_02