1 /*=========================================================================
4 Module: $RCSfile: wxQuantificationWidget.h,v $
6 Date: $Date: 2008/10/31 16:32:43 $
7 Version: $Revision: 1.1 $
9 Copyright: (c) 2002, 2003
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notice for more information.
16 =========================================================================*/
18 #ifndef __WX__MARACAS__QUANTIF__WDG__HXX__
19 #define __WX__MARACAS__QUANTIF__WDG__HXX__
22 #include "vtk3DQuantSurfaceWidget.h"
23 #include "vtk2DQuantSliceWidget.h"
24 #include "wxImageViewerWidget.h"
29 #include <wx/slider.h>
31 #include <wx/minifram.h>
32 #include <wx/splitter.h>
33 #include <kernel/marInterface.h>
34 #include "wxQuantificationWidget_base.h"
40 class wxQuantificationWidget : public wxQuantificationWidget_base
45 ID_QUANTIF3D = wxID_HIGHEST + 1
49 ID_BUTTON_CONTOUR = wxID_HIGHEST + 1,
52 ID_BUTTON_SAVE_CONTOURS3D,
62 ID_CHECKBOX_HEALTHY = wxID_HIGHEST + 1,
63 ID_CHECKBOX_PERPENDICULAR,
64 ID_CHECKBOX_VISIBLE_RINGS,
65 ID_CHECKBOX_SHOW_SURFACE,
66 ID_RADIOBUTTON_GREYSCALE,
74 // Constructor & Destructor
75 wxQuantificationWidget(wxWindow* parent, wxWindowID id = -1,
76 const wxPoint& pos = wxDefaultPosition,
77 const wxSize& size = wxDefaultSize,
78 long style = 0/*wxScrolledWindowStyle*/,
79 const wxString& name = wxPanelNameStr);
81 ~wxQuantificationWidget( );
88 //EED void Positionate( );
90 void Reload_Axis(bool mask, bool step);
91 void Show_Max_Min_Diameters( );
94 void Clean3D( bool eraseAxe = false );
96 virtual void RefreshAxis( );
97 //EED void Refresh_Quant( );
98 void Point_Intensity(double x, double y);
99 void Set_plane_3D( double x, double y );
102 void OnContourWall();
103 void OnContourLumen();
104 void OnContourHypo();
105 void OnContourCalc();
106 void OnReplaceContourWall();
107 void OnReplaceContourLumen();
108 void OnReplaceContourHypo();
109 void OnReplaceContourCalc();
110 void OnSliderDiscontinuityScroll(int percentage);
111 void OnSliderLumenPercentageScroll(int percentage);
112 void OnSliderCalcPercentageScroll(int percentage);
113 void OnCalibration();
115 void OnShowAll(bool value);
116 void OnShowWall(bool value);
117 void OnShowLumen(bool value);
118 void OnShowCalc(bool value);
119 void OnShowHypo(bool value);
121 wxPanel* CreateStenosisPanel();
125 void OnContour_BT(wxCommandEvent& event);
126 void OnClean_BT(wxCommandEvent& event);
127 void OnCleanAll_BT(wxCommandEvent& event);
128 void OnSaveContours3D_BT(wxCommandEvent& event);
130 void OnAutoQuantification_BT(wxCommandEvent& event);
134 virtual void DetectHealthySickSlice( bool minSurf , bool maxSurf );
138 void OnHealthySlice_CB(wxCommandEvent& event);
139 void OnShowSurface_CB(wxCommandEvent& event);
140 void OnVisibleRing_CB(wxCommandEvent& event);
141 void OnPerpendicular_CB(wxCommandEvent& event);
144 void OnGreyScale_RB(wxCommandEvent& event);
145 void OnColor_RB(wxCommandEvent& event);
148 void OnSliderSliceScroll(wxScrollEvent& event);
149 void OnSliderIsovalueScroll(wxScrollEvent& event);
150 void OnSliderOpacityScroll(wxScrollEvent& event);
151 virtual int GetActualSlice();
152 virtual int GetMaxActualSlice();
153 virtual int GetHealthySlice();
154 void GetHealthySliceRange(int &healthySliceStart,int &healthySliceEnd);
155 virtual int GetSizeHealthyRegion();
156 virtual void SetSizeHealthyRegion(int size);
157 virtual void SetHealthySlice(int healthySlice=-1);
159 void ShowMARACASData( marInterface* mar );
160 void CallBackOnMouseWheel( wxMouseEvent& event );
161 void CallBackOnLeftDClick( wxMouseEvent& event );
163 virtual void Set3DRegionSliceActor( int type, int k1,int k2 );
164 virtual void Set3DStartRegionSliceActor( int type, int k );
165 void Set3DEndRegionSliceActor( int type, int k );
167 void Show3DRegionSliceActor(int type );
168 virtual void Show3DStartRegionSliceActor(int type );
169 void Show3DEndRegionSliceActor(int type );
171 void Hide3DRegionSliceActor(int type );
172 virtual void Hide3DStartRegionSliceActor(int type );
173 virtual void Hide3DEndRegionSliceActor(int type );
175 virtual void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
177 int GetAnalysisTypeStenosis();
178 virtual void SetAnalysisTypeStenosis(int analysisTypeStenosis);
180 void SetSlider_Isovalue_Opacity(int isovalue,int opacity);
181 virtual void SetManualContour_2DWorld(bool ok);
182 virtual void SetManualContour_AddPoint_2DWorld();
183 void SetManualContour_InsertPoint_2DWorld();
184 void SetManualContour_ErasePoint_2DWorld();
185 void SetManualContour_MovePoint_2DWorld();
186 virtual void SetManualContour_ReplaceContour();
188 virtual kVolume *GetVolumeAxisExtended(int wz1,int wz2);
196 vtk3DQuantSurfaceWidget *_3DWorld;
197 vtk2DQuantSliceWidget *_2DWorld;
203 wxPanel *_wxStenosisPanel;
204 wxSplitterWindow *panel_splitter;
205 wxSplitterWindow *panel_splitter_right;
206 wxSplitterWindow *panel_splitter_left;
207 // wxPanel *panel_left;
208 wxPanel *panel_left_up;
209 wxPanel *panel_left_down;
210 wxPanel *panel_right;
211 wxPanel *panel_right_up;
212 wxPanel *panel_right_down;
215 wxButton *_bt_AddContour3D;
216 wxButton *_bt_CleanContour3D;
217 wxButton *_bt_CleanAllContours3D;
218 wxButton *_bt_SaveContours3D;
219 wxButton *_bt_Healthy;
221 wxPanelControlsHealthySickSlice2 *_pl_cntlHealthySick2;
224 // wxButton *_bt_ContourCalculated;
225 // wxButton *_bt_Pause;
226 // wxButton *_bt_Delete;
227 // wxButton *_bt_Point;
230 wxRadioButton *_rb_GreyScale;
231 wxRadioButton *_rb_Color;
233 wxCheckBox *_cb_HealthySlice;
234 wxCheckBox *_cb_Perpendicular;
236 wxCheckBox *_cb_VisibleRings;
237 wxCheckBox *_cb_ShowSurface;
239 wxSlider *_sl_Isovalue;
240 wxSlider *_sl_Opacity;
241 wxStaticText *_st_Slice;
242 wxStaticText *_st_Isovalue;
243 wxStaticText *_st_Opacity;
246 // wxStaticText *_st_Label0;
247 // wxStaticText *_st_Value0;
248 wxStaticText *_st_Label1;
249 wxStaticText *_st_Value1;
250 wxStaticText *_st_Label2;
251 wxStaticText *_st_Value2;
252 wxStaticText *_st_Label3;
253 wxStaticText *_st_Value3;
254 // wxStaticText *_st_Label4;
255 // wxStaticText *_st_Value4;
256 // wxStaticText *_st_Label5;
257 // wxStaticText *_st_Value5;
258 wxStaticText *_st_Label6;
259 wxStaticText *_st_Value6;
260 wxStaticText *_st_Label7;
261 wxStaticText *_st_Value7;
262 wxStaticText *_st_Label8;
263 wxStaticText *_st_Value8;
264 // wxStaticText *_st_Label9;
265 // wxStaticText *_st_Value9;
268 wxStaticText *_st_Label100;
269 wxStaticText *_st_Value100;
270 wxStaticText *_st_Label101;
271 wxStaticText *_st_Value101;
272 // wxStaticText *_st_Label102;
273 // wxStaticText *_st_Value102;
274 // wxStaticText *_st_Label103;
275 // wxStaticText *_st_Value103;
276 // wxStaticText *_st_Label104;
277 // wxStaticText *_st_Value104;
278 // wxStaticText *_st_Label105;
279 // wxStaticText *_st_Value105;
280 // wxStaticText *_st_Label106;
281 // wxStaticText *_st_Value106;
282 // wxStaticText *_st_Label107;
283 // wxStaticText *_st_Value107;
284 // wxStaticText *_st_Label108;
285 // wxStaticText *_st_Value108;
288 wxStaticText *_st_LabelRef101;
289 wxStaticText *_st_ValueRef101;
290 wxStaticText *_st_LabelRef102;
291 wxStaticText *_st_ValueRef102;
292 wxStaticText *_st_LabelRef103;
293 wxStaticText *_st_ValueRef103;
301 int _width, _height, _depth;
302 int _bak_ActualSlice;
316 int _first_point_quant;
317 int _last_point_quant;
322 int _sizeHealthyRegion;
330 // float _real_first_point_quant;
331 // float _real_last_point_quant;
340 float _actual_partial;
342 float _ip[3], _fp[3];
345 wxList *_rings_index;
348 wxList *_actual_quant_x;
349 wxList *_actual_quant_area;
350 wxList *_actual_quant_peri;
351 wxList *_actual_quant_darea;
352 wxList *_actual_quant_dperi;
353 wxList *_actual_quant_dmax;
354 wxList *_actual_quant_dmin;
355 wxList *_actual_quant_davg;
356 wxList *_actual_quant_sten;
358 DECLARE_EVENT_TABLE( );
360 void MoveSlider(int actualQuant);
361 void Reset_sl_Slider();
362 void showVariables();
363 wxString strStenosis(double stenosis);
364 double doubleStenosis(double healthy, double sick);
365 double GetStenosisArea(int sickSlice);
366 double GetStenosisDiameter(int sickSlice);
370 #endif // __WX__MARACAS__QUANTIF__WDG