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 /*=========================================================================
29 Module: $RCSfile: wxQuantificationWidget.h,v $
31 Date: $Date: 2012/11/15 14:15:17 $
32 Version: $Revision: 1.2 $
34 Copyright: (c) 2002, 2003
37 This software is distributed WITHOUT ANY WARRANTY; without even
38 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
39 PURPOSE. See the above copyright notice for more information.
41 =========================================================================*/
43 #ifndef __WX__MARACAS__QUANTIF__WDG__HXX__
44 #define __WX__MARACAS__QUANTIF__WDG__HXX__
47 #include "vtk3DQuantSurfaceWidget.h"
48 #include "vtk2DQuantSliceWidget.h"
49 #include "wxImageViewerWidget.h"
54 #include <wx/slider.h>
56 #include <wx/minifram.h>
57 #include <wx/splitter.h>
58 #include <kernel/marInterface.h>
59 #include "wxQuantificationWidget_base.h"
65 class wxQuantificationWidget : public wxQuantificationWidget_base
70 ID_QUANTIF3D = wxID_HIGHEST + 1
74 ID_BUTTON_CONTOUR = wxID_HIGHEST + 1,
77 ID_BUTTON_SAVE_CONTOURS3D,
87 ID_CHECKBOX_HEALTHY = wxID_HIGHEST + 1,
88 ID_CHECKBOX_PERPENDICULAR,
89 ID_CHECKBOX_VISIBLE_RINGS,
90 ID_CHECKBOX_SHOW_SURFACE,
91 ID_RADIOBUTTON_GREYSCALE,
99 // Constructor & Destructor
100 wxQuantificationWidget(wxWindow* parent, wxWindowID id = -1,
101 const wxPoint& pos = wxDefaultPosition,
102 const wxSize& size = wxDefaultSize,
103 long style = 0/*wxScrolledWindowStyle*/,
104 const wxString& name = wxPanelNameStr);
106 ~wxQuantificationWidget( );
113 //EED void Positionate( );
115 void Reload_Axis(bool mask, bool step);
116 void Show_Max_Min_Diameters( );
118 void AddAxisActors();
119 void Clean3D( bool eraseAxe = false );
121 virtual void RefreshAxis( );
122 //EED void Refresh_Quant( );
123 void Point_Intensity(double x, double y);
124 void Set_plane_3D( double x, double y );
127 void OnContourWall();
128 void OnContourLumen();
129 void OnContourHypo();
130 void OnContourCalc();
131 void OnReplaceContourWall();
132 void OnReplaceContourLumen();
133 void OnReplaceContourHypo();
134 void OnReplaceContourCalc();
135 void OnSliderDiscontinuityScroll(int percentage);
136 void OnSliderLumenPercentageScroll(int percentage);
137 void OnSliderCalcPercentageScroll(int percentage);
138 void OnCalibration();
140 void OnShowAll(bool value);
141 void OnShowWall(bool value);
142 void OnShowLumen(bool value);
143 void OnShowCalc(bool value);
144 void OnShowHypo(bool value);
146 wxPanel* CreateStenosisPanel();
150 void OnContour_BT(wxCommandEvent& event);
151 void OnClean_BT(wxCommandEvent& event);
152 void OnCleanAll_BT(wxCommandEvent& event);
153 void OnSaveContours3D_BT(wxCommandEvent& event);
155 void OnAutoQuantification_BT(wxCommandEvent& event);
159 virtual void DetectHealthySickSlice( bool minSurf , bool maxSurf );
163 void OnHealthySlice_CB(wxCommandEvent& event);
164 void OnShowSurface_CB(wxCommandEvent& event);
165 void OnVisibleRing_CB(wxCommandEvent& event);
166 void OnPerpendicular_CB(wxCommandEvent& event);
169 void OnGreyScale_RB(wxCommandEvent& event);
170 void OnColor_RB(wxCommandEvent& event);
173 void OnSliderSliceScroll(wxScrollEvent& event);
174 void OnSliderIsovalueScroll(wxScrollEvent& event);
175 void OnSliderOpacityScroll(wxScrollEvent& event);
176 virtual int GetActualSlice();
177 virtual int GetMaxActualSlice();
178 virtual int GetHealthySlice();
179 void GetHealthySliceRange(int &healthySliceStart,int &healthySliceEnd);
180 virtual int GetSizeHealthyRegion();
181 virtual void SetSizeHealthyRegion(int size);
182 virtual void SetHealthySlice(int healthySlice=-1);
184 void ShowMARACASData( marInterface* mar );
185 void CallBackOnMouseWheel( wxMouseEvent& event );
186 void CallBackOnLeftDClick( wxMouseEvent& event );
188 virtual void Set3DRegionSliceActor( int type, int k1,int k2 );
189 virtual void Set3DStartRegionSliceActor( int type, int k );
190 void Set3DEndRegionSliceActor( int type, int k );
192 void Show3DRegionSliceActor(int type );
193 virtual void Show3DStartRegionSliceActor(int type );
194 void Show3DEndRegionSliceActor(int type );
196 void Hide3DRegionSliceActor(int type );
197 virtual void Hide3DStartRegionSliceActor(int type );
198 virtual void Hide3DEndRegionSliceActor(int type );
200 virtual void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
202 int GetAnalysisTypeStenosis();
203 virtual void SetAnalysisTypeStenosis(int analysisTypeStenosis);
205 void SetSlider_Isovalue_Opacity(int isovalue,int opacity);
206 virtual void SetManualContour_2DWorld(bool ok);
207 virtual void SetManualContour_AddPoint_2DWorld();
208 void SetManualContour_InsertPoint_2DWorld();
209 void SetManualContour_ErasePoint_2DWorld();
210 void SetManualContour_MovePoint_2DWorld();
211 virtual void SetManualContour_ReplaceContour();
213 virtual kVolume *GetVolumeAxisExtended(int wz1,int wz2);
221 vtk3DQuantSurfaceWidget *_3DWorld;
222 vtk2DQuantSliceWidget *_2DWorld;
228 wxPanel *_wxStenosisPanel;
229 wxSplitterWindow *panel_splitter;
230 wxSplitterWindow *panel_splitter_right;
231 wxSplitterWindow *panel_splitter_left;
232 // wxPanel *panel_left;
233 wxPanel *panel_left_up;
234 wxPanel *panel_left_down;
235 wxPanel *panel_right;
236 wxPanel *panel_right_up;
237 wxPanel *panel_right_down;
240 wxButton *_bt_AddContour3D;
241 wxButton *_bt_CleanContour3D;
242 wxButton *_bt_CleanAllContours3D;
243 wxButton *_bt_SaveContours3D;
244 wxButton *_bt_Healthy;
246 wxPanelControlsHealthySickSlice2 *_pl_cntlHealthySick2;
249 // wxButton *_bt_ContourCalculated;
250 // wxButton *_bt_Pause;
251 // wxButton *_bt_Delete;
252 // wxButton *_bt_Point;
255 wxRadioButton *_rb_GreyScale;
256 wxRadioButton *_rb_Color;
258 wxCheckBox *_cb_HealthySlice;
259 wxCheckBox *_cb_Perpendicular;
261 wxCheckBox *_cb_VisibleRings;
262 wxCheckBox *_cb_ShowSurface;
264 wxSlider *_sl_Isovalue;
265 wxSlider *_sl_Opacity;
266 wxStaticText *_st_Slice;
267 wxStaticText *_st_Isovalue;
268 wxStaticText *_st_Opacity;
271 // wxStaticText *_st_Label0;
272 // wxStaticText *_st_Value0;
273 wxStaticText *_st_Label1;
274 wxStaticText *_st_Value1;
275 wxStaticText *_st_Label2;
276 wxStaticText *_st_Value2;
277 wxStaticText *_st_Label3;
278 wxStaticText *_st_Value3;
279 // wxStaticText *_st_Label4;
280 // wxStaticText *_st_Value4;
281 // wxStaticText *_st_Label5;
282 // wxStaticText *_st_Value5;
283 wxStaticText *_st_Label6;
284 wxStaticText *_st_Value6;
285 wxStaticText *_st_Label7;
286 wxStaticText *_st_Value7;
287 wxStaticText *_st_Label8;
288 wxStaticText *_st_Value8;
289 // wxStaticText *_st_Label9;
290 // wxStaticText *_st_Value9;
293 wxStaticText *_st_Label100;
294 wxStaticText *_st_Value100;
295 wxStaticText *_st_Label101;
296 wxStaticText *_st_Value101;
297 // wxStaticText *_st_Label102;
298 // wxStaticText *_st_Value102;
299 // wxStaticText *_st_Label103;
300 // wxStaticText *_st_Value103;
301 // wxStaticText *_st_Label104;
302 // wxStaticText *_st_Value104;
303 // wxStaticText *_st_Label105;
304 // wxStaticText *_st_Value105;
305 // wxStaticText *_st_Label106;
306 // wxStaticText *_st_Value106;
307 // wxStaticText *_st_Label107;
308 // wxStaticText *_st_Value107;
309 // wxStaticText *_st_Label108;
310 // wxStaticText *_st_Value108;
313 wxStaticText *_st_LabelRef101;
314 wxStaticText *_st_ValueRef101;
315 wxStaticText *_st_LabelRef102;
316 wxStaticText *_st_ValueRef102;
317 wxStaticText *_st_LabelRef103;
318 wxStaticText *_st_ValueRef103;
326 int _width, _height, _depth;
327 int _bak_ActualSlice;
341 int _first_point_quant;
342 int _last_point_quant;
347 int _sizeHealthyRegion;
355 // float _real_first_point_quant;
356 // float _real_last_point_quant;
365 float _actual_partial;
367 float _ip[3], _fp[3];
370 wxList *_rings_index;
373 wxList *_actual_quant_x;
374 wxList *_actual_quant_area;
375 wxList *_actual_quant_peri;
376 wxList *_actual_quant_darea;
377 wxList *_actual_quant_dperi;
378 wxList *_actual_quant_dmax;
379 wxList *_actual_quant_dmin;
380 wxList *_actual_quant_davg;
381 wxList *_actual_quant_sten;
383 DECLARE_EVENT_TABLE( );
385 void MoveSlider(int actualQuant);
386 void Reset_sl_Slider();
387 void showVariables();
388 wxString strStenosis(double stenosis);
389 double doubleStenosis(double healthy, double sick);
390 double GetStenosisArea(int sickSlice);
391 double GetStenosisDiameter(int sickSlice);
395 #endif // __WX__MARACAS__QUANTIF__WDG