1 /*=========================================================================
4 Module: $RCSfile: wxQuantificationWidgetCT.h,v $
6 Date: $Date: 2009/05/14 13:54:57 $
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__CT__WDG__HXX__
19 #define __WX__MARACAS__QUANTIF__CT__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/marInterfaceCT.h>
34 #include "wxQuantificationWidget_base.h"
35 #include "ContourView.h"
36 #include "PointView.h"
38 #include "../manualContourContainer.h"
43 class wxQuantificationWidgetCT : public wxQuantificationWidget_base
48 ID_QUANTIF3D = wxID_HIGHEST + 1
52 ID_BUTTON_CONTOUR = wxID_HIGHEST + 1,
64 ID_CHECKBOX_HEALTHY = wxID_HIGHEST + 1,
65 ID_CHECKBOX_PERPENDICULAR,
66 ID_CHECKBOX_VISIBLE_RINGS,
67 ID_CHECKBOX_SHOW_SURFACE,
68 ID_RADIOBUTTON_GREYSCALE,
78 // Constructor & Destructor
79 wxQuantificationWidgetCT(wxWindow* parent, wxWindowID id = -1,
80 const wxPoint& pos = wxDefaultPosition,
81 const wxSize& size = wxDefaultSize,
82 long style = 0/*wxScrolledWindowStyle*/,
83 const wxString& name = wxPanelNameStr);
85 ~wxQuantificationWidgetCT( );
89 // void Set_control( );
93 //EED void Positionate( );
95 void Reload_Axis(bool mask, bool step);
96 void Show_Max_Min_Diameters( );
99 void Clean3D( bool eraseAxe = false );
102 //EED void Refresh_Quant( );
103 void Point_Intensity(double x, double y);
104 void Set_plane_3D( double x, double y );
110 void OnContour_BT(wxCommandEvent& event);
111 void OnClean_BT(wxCommandEvent& event);
112 void OnCleanAll_BT(wxCommandEvent& event);
115 void OnAutoQuantification_BT(wxCommandEvent& event);
119 void DetectHealthySickSlice( bool minSurf , bool maxSurf );
122 void OnHealthySlice_CB(wxCommandEvent& event);
123 void OnShowSurface_CB(wxCommandEvent& event);
124 void OnVisibleRing_CB(wxCommandEvent& event);
125 void OnPerpendicular_CB(wxCommandEvent& event);
128 void OnGreyScale_RB(wxCommandEvent& event);
129 void OnColor_RB(wxCommandEvent& event);
132 void OnSliderSliceScroll(wxScrollEvent& event);
133 void OnSliderIsovalueScroll(wxScrollEvent& event);
134 void OnSliderOpacityScroll(wxScrollEvent& event);
136 int GetActualSlice();
137 void SetActualSlice(int slice);
138 int GetMaxActualSlice();
139 int GetHealthySlice();
140 void GetHealthySliceRange(int &healthySliceStart,int &healthySliceEnd);
141 int GetSizeHealthyRegion();
142 void SetSizeHealthyRegion(int size);
143 void SetHealthySlice(int healthySlice=-1);
145 void MoveSlider(int actualQuant);
148 void ShowMARACASData( marInterfaceCT* mar );
149 void CallBackOnMouseWheel( wxMouseEvent& event );
150 void CallBackOnLeftDClick( wxMouseEvent& event );
152 void Set3DRegionSliceActor( int type, int k1,int k2 );
153 void Set3DStartRegionSliceActor( int type, int k );
154 void Set3DEndRegionSliceActor( int type, int k );
156 void Show3DRegionSliceActor(int type );
157 void Show3DStartRegionSliceActor(int type );
158 void Show3DEndRegionSliceActor(int type );
160 void Hide3DRegionSliceActor(int type );
161 void Hide3DStartRegionSliceActor(int type );
162 void Hide3DEndRegionSliceActor(int type );
164 void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
166 int GetAnalysisTypeStenosis();
167 void SetAnalysisTypeStenosis(int analysisTypeStenosis);
169 void SetSlider_Isovalue_Opacity(int isovalue,int opacity);
170 void SetManualContour_2DWorld(bool ok);
171 void SetManualContour_AddPoint_2DWorld();
172 void SetManualContour_InsertPoint_2DWorld();
173 void SetManualContour_ErasePoint_2DWorld();
174 void SetManualContour_MovePoint_2DWorld();
175 void SetManualContour_ReplaceContour();
177 kVolume *GetVolumeAxisExtended(int wz1,int wz2);
181 void RefreshView(marImageData *marimagedata);
182 void ConfigureVTK(marImageData *marimagedata);
184 void OnContourWall();
185 void OnContourLumen();
186 void OnContourHypo();
187 void OnContourCalc();
188 void OnReplaceContourWall();
189 void OnReplaceContourLumen();
190 void OnReplaceContourHypo();
191 void OnReplaceContourCalc();
193 void OnSliderDiscontinuityScroll(int percentage);
194 void OnSliderLumenPercentageScroll(int percentage);
195 void OnSliderCalcPercentageScroll(int percentage);
196 void OnCalibration();
199 void OnShowAll(bool value);
200 void OnShowWall(bool value);
201 void OnShowLumen(bool value);
202 void OnShowCalc(bool value);
203 void OnShowHypo(bool value);
213 WALL = 1, /*!< Wall Type. */
214 CALCIFICATION, /*!< Calcification Type. */
215 HYPODENSE, /*!< Hypodense Type. */
216 ELUMEN /*!< Extracted Lumen */
222 marInterfaceCT *_mar;
225 vtk3DQuantSurfaceWidget *_3DWorld;
226 // vtk2DQuantSliceWidget *_2DWorld;
229 wxVtk2DBaseView *_imageviewer2D_1;
231 vtkBaseData *_vtkbasedata_1;
234 //Manual Contour Wall
235 /*manualContourControler *_manContourControlWall;
236 manualContourModel *_mContourModelWall;
237 manualViewContour *_mViewContourWall;
239 //Manual Contour Lumen
240 manualContourControler *_manContourControlLumen;
241 manualContourModel *_mContourModelLumen;
242 manualViewContour *_mViewContourLumen;
244 //Manual Contour Calc
245 std::vector <manualContourControler *> _manContourControlCalc;
246 std::vector <manualContourModel *> _mContourModelCalc;
247 std::vector <manualViewContour *> _mViewContourCalc;
249 //Manual Contour Hypo
250 std::vector <manualContourControler *> _manContourControlHypo;
251 std::vector <manualContourModel *> _mContourModelHypo;
252 std::vector <manualViewContour *> _mViewContourHypo;
255 std::vector <manualContourContainer *> _manContours;
256 //Default contours, points and lines viewing
257 ContourView *_contourViewer;
258 LineView *_lineViewer;
259 PointView *_pointViewer;
265 wxWindow *_wxStenosisPanel;
267 // wxSplitterWindow *panel_splitter;
268 // wxSplitterWindow *panel_splitter_right;
269 // wxPanel *panel_left;
270 // wxPanel *panel_right_up;
271 // wxPanel *panel_right_down;
272 // wxPanel *panel_rightm_up;
275 wxButton *_bt_AddContour3D;
276 wxButton *_bt_CleanContour3D;
277 wxButton *_bt_CleanAllContours3D;
278 wxButton *_bt_Healthy;
280 wxPanelControlsHealthySickSliceCT *_pl_cntlHealthySick2;
283 // wxButton *_bt_ContourCalculated;
284 // wxButton *_bt_Pause;
285 // wxButton *_bt_Delete;
286 // wxButton *_bt_Point;
289 wxRadioButton *_rb_GreyScale;
290 wxRadioButton *_rb_Color;
292 wxCheckBox *_cb_HealthySlice;
293 wxCheckBox *_cb_Perpendicular;
295 wxCheckBox *_cb_VisibleRings;
296 wxCheckBox *_cb_ShowSurface;
298 wxSlider *_sl_Isovalue;
299 wxSlider *_sl_Opacity;
300 wxStaticText *_st_Slice;
301 wxStaticText *_st_Isovalue;
302 wxStaticText *_st_Opacity;
306 // wxStaticText *_st_Label0;
307 // wxStaticText *_st_Value0;
308 wxStaticText *_txt_Position;
310 wxStaticText *_st_Label1;
311 wxStaticText *_st_Value1;
312 wxStaticText *_st_Label2;
313 wxStaticText *_st_Value2;
314 wxStaticText *_st_Label3;
315 wxStaticText *_st_Value3;
316 // wxStaticText *_st_Label4;
317 // wxStaticText *_st_Value4;
318 // wxStaticText *_st_Label5;
319 // wxStaticText *_st_Value5;
320 wxStaticText *_st_Label6;
321 wxStaticText *_st_Value6;
322 wxStaticText *_st_Label7;
323 wxStaticText *_st_Value7;
324 wxStaticText *_st_Label8;
325 wxStaticText *_st_Value8;
326 // wxStaticText *_st_Label9;
327 // wxStaticText *_st_Value9;
330 wxStaticText *_st_Label100;
331 wxStaticText *_st_Value100;
332 wxStaticText *_st_Label101;
333 wxStaticText *_st_Value101;
334 // wxStaticText *_st_Label102;
335 // wxStaticText *_st_Value102;
336 // wxStaticText *_st_Label103;
337 // wxStaticText *_st_Value103;
338 // wxStaticText *_st_Label104;
339 // wxStaticText *_st_Value104;
340 // wxStaticText *_st_Label105;
341 // wxStaticText *_st_Value105;
342 // wxStaticText *_st_Label106;
343 // wxStaticText *_st_Value106;
344 // wxStaticText *_st_Label107;
345 // wxStaticText *_st_Value107;
346 // wxStaticText *_st_Label108;
347 // wxStaticText *_st_Value108;
350 wxStaticText *_st_LabelRef101;
351 wxStaticText *_st_ValueRef101;
352 wxStaticText *_st_LabelRef102;
353 wxStaticText *_st_ValueRef102;
354 wxStaticText *_st_LabelRef103;
355 wxStaticText *_st_ValueRef103;
363 int _width, _height, _depth;
364 int _bak_ActualSlice;
365 int _bak_ActualSlice2;
379 int _first_point_quant;
380 int _last_point_quant;
385 int _sizeHealthyRegion;
393 // float _real_first_point_quant;
394 // float _real_last_point_quant;
403 float _actual_partial;
405 float _ip[3], _fp[3];
408 wxList *_rings_index;
411 wxList *_actual_quant_x;
412 wxList *_actual_quant_area;
413 wxList *_actual_quant_peri;
414 wxList *_actual_quant_darea;
415 wxList *_actual_quant_dperi;
416 wxList *_actual_quant_dmax;
417 wxList *_actual_quant_dmin;
418 wxList *_actual_quant_davg;
419 wxList *_actual_quant_sten;
421 DECLARE_EVENT_TABLE( );
423 void Reset_sl_Slider();
424 void showVariables();
425 wxString strStenosis(double stenosis);
426 double doubleStenosis(double healthy, double sick);
427 double GetStenosisArea(int sickSlice);
428 double GetStenosisDiameter(int sickSlice);
429 wxWindow* CreateView2DPanel(wxWindow *parent);
430 void CreateManualContours();
431 void addManualContours(int type);
433 wxSplitterWindow *_splitPanelPrincipal;
434 wxSplitterWindow *_splitpanel_left;
435 wxSplitterWindow *_splitpanel_right;
436 wxSplitterWindow *_splitpanel_right_down;
438 wxWindow* CreatePanelPrincipal(wxWindow *parent);
439 wxWindow* CreatePanelStatus(wxWindow *parent);
440 wxWindow* CreatePanel_Left(wxWindow *parent);
441 wxWindow* CreatePanel_Right(wxWindow *parent);
442 wxWindow* CreateStenosisPanel(wxWindow *parent);
443 wxWindow* CreateControlPanel3D(wxWindow *parent);
444 wxWindow* CreatePanel_Right_Down(wxWindow *parent);
451 #endif // __WX__MARACAS__QUANTIF__CT__WDG__HXX__