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 <marInterface.h>
27 #include <axisExtractor02.h>
30 #include "vtkSTLExtractor.h"
31 #include "vtkJoiner.h"
38 //------------------------------------------------------------------
39 //------------------------------------------------------------------
40 //------------------------------------------------------------------
42 class creaMaracasVisu_EXPORT wxSTLWidget_03: public wxPanel{
44 wxSTLWidget_03(wxWindow *parentmar);//,marInterface *mar);
49 void OnOpacity_Vol(wxScrollEvent& event); // Result Volume
50 void OnMinSpin ( wxScrollEvent & event );
51 void OnMaxSpin ( wxScrollEvent & event );
54 void OnRangeSpin( wxScrollEvent & event );
56 //Handled events form the bar
57 void OnStartChanged_range(wxCommandEvent& event);
58 void OnEndChanged_range(wxCommandEvent& event);
59 void OnBarMoved_range(wxCommandEvent& event);
62 void OnBtnExtraction(wxCommandEvent& event);
63 void OnBtnSaveBinaryFile(wxCommandEvent& event);
66 void Reset_vtk_STLFile();
67 void OnBtnSTLFileLoad(wxCommandEvent& event);
68 void OnBtnSTLFileErase(wxCommandEvent& event);
69 void OnOpacitySTLFile(wxScrollEvent& event);
72 // --------------------------------------
74 // --------------------------------------
75 void generateSTLSurfaces();
76 void OnBtnCreateFileSTL(wxCommandEvent& event);
77 void OnChangeSTLGaussLevel(wxScrollEvent& event);
78 void OnChangeSTLMarchingCubesLevel(wxScrollEvent& event);
79 void OnOpacitySTLExternal(wxScrollEvent& event);
80 void OnOpacitySTLInternal(wxScrollEvent& event);
83 //---------------------------------------
84 // JOIN REGIONS FUNCTIONS
85 //---------------------------------------
86 void OnJoinRegions(wxCommandEvent& event);
89 void setImage(vtkImageData* img);
94 vtkImageData *_imagedata;
98 vtkImageCast *cast4; // binary segmentation result
99 vtkImageThreshold *_thresh;
100 vtkImageThreshold *_thresh2;
101 vtkImageCast * _cast;
102 vtkImageSeedConnectivity *_connect;
103 vtkImageSeedConnectivity *_connect2;
107 vtkPolyDataMapper *_2_mapfinal;
108 vtkActor *_2_stripfinal;
109 vtkPolyDataMapper *_2_isoMapperMC6;
110 vtkActor *_2_isoActorMC6;
111 vtkMarchingCubes *_2_isoMC6;
112 double _sensibility_JF;
117 vtkPolyDataMapper *_loadSTLMapper;
118 vtkActor *_loadActorSTL;
121 wxSlider *_opacity_Vol;
122 wxSlider *_sl_minSize;
123 wxSlider *_sl_maxSize;
124 wxSlider *_sl_minSizeSpin;
125 wxSlider *_sl_maxSizeSpin;
126 wxSlider *_sl_RangeSizeSpin;
130 * Represents the bar of min and max for merging the functionality of two sliders for controlling the segmentation parameters
132 mBarRange * sl_barrange_segmentation;
133 int lastResizeRef_Value;
137 wxVtk3DBaseView *_imageviewer3D;
138 wxPanel *CreateControlPanel(wxWindow *parent);
139 wxPanel *CreateViewPanel(wxWindow *parent);
142 //marInterface *_mar;
143 wxMaracasMPR *_wxMaracasMPR;
145 void ResetTree2_JF();
146 void ExtractSurface(int x, int y, int z);
148 wxWindow* CreateSelectAPointPanel(wxWindow *parent);
149 wxWindow* CreateSegmentationPanel(wxWindow *parent);
150 wxWindow* CreateSmoothingPanel(wxWindow *parent);
151 wxWindow* CreateReadSTLFilePanel(wxWindow *parent);
153 //---------------------
155 //---------------------
156 void ConfigureProcessing(vtkImageData *img, int x, int y, int z);
159 //---------------------
161 //---------------------
163 double _stlDeltaGaussLevel;
164 double _stlMarchingCubesLevel;
167 vtkPolyData *stlInterna;
168 vtkPolyData *stlExterna;
170 wxSlider *stlSliderDeltaGauss;
171 wxSlider *stlSliderMarchingCubes;
173 vtkPolyDataMapper *dsm1;
174 vtkActor *actorInternal;
175 wxSlider *stlSliderOpacityInternal;
177 vtkPolyDataMapper *dsm2;
178 vtkActor *actorExternal;
179 wxSlider *stlSliderOpacityExternal;
181 vtkSTLExtractor *stlExtractor;
183 wxSlider *_sl_opacity_STL_file;
187 //--------------------------
189 //--------------------------
191 vtkImageData *arteryImageData;
193 vtkMarchingCubes *joinMarchingCubes;
194 vtkPolyDataMapper *joinMapper;
199 #endif // WX_STL_WIDGET_03