2 #ifndef WX_STL_WIDGET_03
3 #define WX_STL_WIDGET_03
7 #include <vtkImageData.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>
18 #include "wxVTKRenderWindowInteractor.h"
19 #include "wxSurfaceWidget.h"
20 #include "wxVtkBaseView.h"
23 #include "../wxMaracasMPR.h"
24 #include "pPlotter/mBarRange.h"//SIL//
26 #include <kernel/marInterface.h>
27 #include <kernel/axisExtractor02.h>
30 #include "kernel/vtkSTLExtractor.h"
31 #include "kernel/vtkJoiner.h"
36 //------------------------------------------------------------------
37 //------------------------------------------------------------------
38 //------------------------------------------------------------------
40 class wxSTLWidget_03: public wxPanel{
42 wxSTLWidget_03(wxWindow *parentmar,marInterface *mar);
47 void OnOpacity_Vol(wxScrollEvent& event); // Result Volume
48 void OnMinSpin ( wxScrollEvent & event );
49 void OnMaxSpin ( wxScrollEvent & event );
52 void OnRangeSpin( wxScrollEvent & event );
54 //Handled events form the bar
55 void OnStartChanged_range(wxCommandEvent& event);
56 void OnEndChanged_range(wxCommandEvent& event);
57 void OnBarMoved_range(wxCommandEvent& event);
60 void OnBtnExtraction(wxCommandEvent& event);
61 void OnBtnSaveBinaryFile(wxCommandEvent& event);
64 void Reset_vtk_STLFile();
65 void OnBtnSTLFileLoad(wxCommandEvent& event);
66 void OnBtnSTLFileErase(wxCommandEvent& event);
67 void OnOpacitySTLFile(wxScrollEvent& event);
70 // --------------------------------------
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);
81 //---------------------------------------
82 // JOIN REGIONS FUNCTIONS
83 //---------------------------------------
84 void OnJoinRegions(wxCommandEvent& event);
89 vtkImageData *_imagedata;
93 vtkImageCast *cast4; // binary segmentation result
94 vtkImageThreshold *_thresh;
95 vtkImageThreshold *_thresh2;
96 vtkImageSeedConnectivity *_connect;
97 vtkImageSeedConnectivity *_connect2;
101 vtkPolyDataMapper *_2_mapfinal;
102 vtkActor *_2_stripfinal;
103 vtkPolyDataMapper *_2_isoMapperMC6;
104 vtkActor *_2_isoActorMC6;
105 vtkMarchingCubes *_2_isoMC6;
106 double _sensibility_JF;
111 vtkPolyDataMapper *_loadSTLMapper;
112 vtkActor *_loadActorSTL;
115 wxSlider *_opacity_Vol;
116 wxSlider *_sl_minSize;
117 wxSlider *_sl_maxSize;
118 wxSlider *_sl_minSizeSpin;
119 wxSlider *_sl_maxSizeSpin;
120 wxSlider *_sl_RangeSizeSpin;
124 * Represents the bar of min and max for merging the functionality of two sliders for controlling the segmentation parameters
126 mBarRange * sl_barrange_segmentation;
127 int lastResizeRef_Value;
131 wxVtk3DBaseView *_imageviewer3D;
132 wxPanel *CreateControlPanel(wxWindow *parent);
133 wxPanel *CreateViewPanel(wxWindow *parent);
137 wxMaracasMPR *_wxMaracasMPR;
139 void ResetTree2_JF();
140 void ExtractSurface(int x, int y, int z);
142 wxWindow* CreateSelectAPointPanel(wxWindow *parent);
143 wxWindow* CreateSegmentationPanel(wxWindow *parent);
144 wxWindow* CreateSmoothingPanel(wxWindow *parent);
145 wxWindow* CreateReadSTLFilePanel(wxWindow *parent);
147 //---------------------
149 //---------------------
150 void ConfigureProcessing(marImageData *marimagedata, int x, int y, int z);
153 //---------------------
155 //---------------------
157 double _stlDeltaGaussLevel;
158 double _stlMarchingCubesLevel;
161 vtkPolyData *stlInterna;
162 vtkPolyData *stlExterna;
164 wxSlider *stlSliderDeltaGauss;
165 wxSlider *stlSliderMarchingCubes;
167 vtkPolyDataMapper *dsm1;
168 vtkActor *actorInternal;
169 wxSlider *stlSliderOpacityInternal;
171 vtkPolyDataMapper *dsm2;
172 vtkActor *actorExternal;
173 wxSlider *stlSliderOpacityExternal;
175 vtkSTLExtractor *stlExtractor;
177 wxSlider *_sl_opacity_STL_file;
181 //--------------------------
183 //--------------------------
185 vtkImageData *arteryImageData;
187 vtkMarchingCubes *joinMarchingCubes;
188 vtkPolyDataMapper *joinMapper;
193 #endif // WX_STL_WIDGET_03