wxQuantificationWidgetCT.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __WX__MARACAS__QUANTIF__CT__WDG__HXX__
00019 #define __WX__MARACAS__QUANTIF__CT__WDG__HXX__
00020
00021
00022 #include "vtk3DQuantSurfaceWidget.h"
00023 #include "vtk2DQuantSliceWidget.h"
00024 #include "wxImageViewerWidget.h"
00025
00026 #include "wxChart.h"
00027
00028 #include <wx/wx.h>
00029 #include <wx/slider.h>
00030 #include <wx/panel.h>
00031 #include <wx/minifram.h>
00032 #include <wx/splitter.h>
00033 #include <kernel/marInterfaceCT.h>
00034 #include "wxQuantificationWidget_base.h"
00035 #include "ContourView.h"
00036 #include "PointView.h"
00037 #include "LineView.h"
00038 #include "../manualContourContainer.h"
00039 #include <vector>
00040
00041
00042
00043 class wxQuantificationWidgetCT : public wxQuantificationWidget_base
00044 {
00045 public:
00046
00047 enum WidgetsIDs {
00048 ID_QUANTIF3D = wxID_HIGHEST + 1
00049 };
00050
00051 enum FunctionIDs {
00052 ID_BUTTON_CONTOUR = wxID_HIGHEST + 1,
00053 ID_BUTTON_CLEAN,
00054 ID_BUTTON_CLEAN_ALL,
00055 ID_BUTTON_AUTOQUANT,
00056 ID_BUTTON_HEALTHY,
00057 ID_BUTTON_CALCULATED,
00058 ID_BUTTON_PAUSE,
00059 ID_BUTTON_DELETE,
00060 ID_BUTTON_POINT
00061 };
00062
00063 enum ParamIDs {
00064 ID_CHECKBOX_HEALTHY = wxID_HIGHEST + 1,
00065 ID_CHECKBOX_PERPENDICULAR,
00066 ID_CHECKBOX_VISIBLE_RINGS,
00067 ID_CHECKBOX_SHOW_SURFACE,
00068 ID_RADIOBUTTON_GREYSCALE,
00069 ID_RADIOBUTTON_COLOR,
00070 ID_SLIDER_SLICE,
00071 ID_SLIDER_SLICE22,
00072 ID_SLIDER_ISOVALUE,
00073 ID_SLIDER_OPACITY
00074 };
00075
00076
00077
00078
00079 wxQuantificationWidgetCT(wxWindow* parent, wxWindowID id = -1,
00080 const wxPoint& pos = wxDefaultPosition,
00081 const wxSize& size = wxDefaultSize,
00082 long style = 0,
00083 const wxString& name = wxPanelNameStr);
00084
00085 ~wxQuantificationWidgetCT( );
00086
00087
00088
00089
00090
00091 void Set_Data( );
00092
00093
00094 void Forget( );
00095 void Reload_Axis(bool mask, bool step);
00096 void Show_Max_Min_Diameters( );
00097 int Back( );
00098 void AddAxisActors();
00099 void Clean3D( bool eraseAxe = false );
00100 void ResetAxis( );
00101 void RefreshAxis( );
00102
00103 void Point_Intensity(double x, double y);
00104 void Set_plane_3D( double x, double y );
00105 void CleanContour();
00106
00107
00108
00109 void Do_Quant( );
00110 void OnContour_BT(wxCommandEvent& event);
00111 void OnClean_BT(wxCommandEvent& event);
00112 void OnCleanAll_BT(wxCommandEvent& event);
00113
00114
00115 void OnAutoQuantification_BT(wxCommandEvent& event);
00116
00117
00118
00119 void DetectHealthySickSlice( bool minSurf , bool maxSurf );
00120
00121
00122 void OnHealthySlice_CB(wxCommandEvent& event);
00123 void OnShowSurface_CB(wxCommandEvent& event);
00124 void OnVisibleRing_CB(wxCommandEvent& event);
00125 void OnPerpendicular_CB(wxCommandEvent& event);
00126
00127
00128 void OnGreyScale_RB(wxCommandEvent& event);
00129 void OnColor_RB(wxCommandEvent& event);
00130
00131
00132 void OnSliderSliceScroll(wxScrollEvent& event);
00133 void OnSliderIsovalueScroll(wxScrollEvent& event);
00134 void OnSliderOpacityScroll(wxScrollEvent& event);
00135
00136 int GetActualSlice();
00137 void SetActualSlice(int slice);
00138 int GetMaxActualSlice();
00139 int GetHealthySlice();
00140 void GetHealthySliceRange(int &healthySliceStart,int &healthySliceEnd);
00141 int GetSizeHealthyRegion();
00142 void SetSizeHealthyRegion(int size);
00143 void SetHealthySlice(int healthySlice=-1);
00144
00145 void MoveSlider(int actualQuant);
00146
00147
00148 void ShowMARACASData( marInterfaceCT* mar );
00149 void CallBackOnMouseWheel( wxMouseEvent& event );
00150 void CallBackOnLeftDClick( wxMouseEvent& event );
00151
00152 void Set3DRegionSliceActor( int type, int k1,int k2 );
00153 void Set3DStartRegionSliceActor( int type, int k );
00154 void Set3DEndRegionSliceActor( int type, int k );
00155
00156 void Show3DRegionSliceActor(int type );
00157 void Show3DStartRegionSliceActor(int type );
00158 void Show3DEndRegionSliceActor(int type );
00159
00160 void Hide3DRegionSliceActor(int type );
00161 void Hide3DStartRegionSliceActor(int type );
00162 void Hide3DEndRegionSliceActor(int type );
00163
00164 void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
00165
00166 int GetAnalysisTypeStenosis();
00167 void SetAnalysisTypeStenosis(int analysisTypeStenosis);
00168
00169 void SetSlider_Isovalue_Opacity(int isovalue,int opacity);
00170 void SetManualContour_2DWorld(bool ok);
00171 void SetManualContour_AddPoint_2DWorld();
00172 void SetManualContour_InsertPoint_2DWorld();
00173 void SetManualContour_ErasePoint_2DWorld();
00174 void SetManualContour_MovePoint_2DWorld();
00175 void SetManualContour_ReplaceContour();
00176
00177 kVolume *GetVolumeAxisExtended(int wz1,int wz2);
00178
00179
00180 void Refresh();
00181 void RefreshView(marImageData *marimagedata);
00182 void ConfigureVTK(marImageData *marimagedata);
00183
00184 void OnContourWall();
00185 void OnContourLumen();
00186 void OnContourHypo();
00187 void OnContourCalc();
00188 void OnReplaceContourWall();
00189 void OnReplaceContourLumen();
00190 void OnReplaceContourHypo();
00191 void OnReplaceContourCalc();
00192
00193 void OnSliderDiscontinuityScroll(int percentage);
00194 void OnSliderLumenPercentageScroll(int percentage);
00195 void OnSliderCalcPercentageScroll(int percentage);
00196 void OnCalibration();
00197 void OnFile();
00198
00199 void OnShowAll(bool value);
00200 void OnShowWall(bool value);
00201 void OnShowLumen(bool value);
00202 void OnShowCalc(bool value);
00203 void OnShowHypo(bool value);
00204
00205 void performXOR();
00206 void performAND();
00207 void getIndex();
00208
00209 private:
00210
00211 enum ContourTypes
00212 {
00213 WALL = 1,
00214 CALCIFICATION,
00215 HYPODENSE,
00216 ELUMEN
00217 };
00218
00219
00220
00221
00222 marInterfaceCT *_mar;
00223
00224
00225 vtk3DQuantSurfaceWidget *_3DWorld;
00226
00227
00228
00229 wxVtk2DBaseView *_imageviewer2D_1;
00230 vtkImageData *_data;
00231 vtkBaseData *_vtkbasedata_1;
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255 std::vector <manualContourContainer *> _manContours;
00256
00257 ContourView *_contourViewer;
00258 LineView *_lineViewer;
00259 PointView *_pointViewer;
00260
00261
00262
00263
00264
00265 wxWindow *_wxStenosisPanel;
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275 wxButton *_bt_AddContour3D;
00276 wxButton *_bt_CleanContour3D;
00277 wxButton *_bt_CleanAllContours3D;
00278 wxButton *_bt_Healthy;
00279
00280 wxPanelControlsHealthySickSliceCT *_pl_cntlHealthySick2;
00281
00282
00283
00284
00285
00286
00287
00288
00289 wxRadioButton *_rb_GreyScale;
00290 wxRadioButton *_rb_Color;
00291
00292 wxCheckBox *_cb_HealthySlice;
00293 wxCheckBox *_cb_Perpendicular;
00294
00295 wxCheckBox *_cb_VisibleRings;
00296 wxCheckBox *_cb_ShowSurface;
00297 wxSlider *_sl_Slice;
00298 wxSlider *_sl_Isovalue;
00299 wxSlider *_sl_Opacity;
00300 wxStaticText *_st_Slice;
00301 wxStaticText *_st_Isovalue;
00302 wxStaticText *_st_Opacity;
00303
00304
00305
00306
00307
00308 wxStaticText *_txt_Position;
00309
00310 wxStaticText *_st_Label1;
00311 wxStaticText *_st_Value1;
00312 wxStaticText *_st_Label2;
00313 wxStaticText *_st_Value2;
00314 wxStaticText *_st_Label3;
00315 wxStaticText *_st_Value3;
00316
00317
00318
00319
00320 wxStaticText *_st_Label6;
00321 wxStaticText *_st_Value6;
00322 wxStaticText *_st_Label7;
00323 wxStaticText *_st_Value7;
00324 wxStaticText *_st_Label8;
00325 wxStaticText *_st_Value8;
00326
00327
00328
00329
00330 wxStaticText *_st_Label100;
00331 wxStaticText *_st_Value100;
00332 wxStaticText *_st_Label101;
00333 wxStaticText *_st_Value101;
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350 wxStaticText *_st_LabelRef101;
00351 wxStaticText *_st_ValueRef101;
00352 wxStaticText *_st_LabelRef102;
00353 wxStaticText *_st_ValueRef102;
00354 wxStaticText *_st_LabelRef103;
00355 wxStaticText *_st_ValueRef103;
00356
00357
00358
00359
00360
00361 int _numpoint;
00362 int _axis_index;
00363 int _width, _height, _depth;
00364 int _bak_ActualSlice;
00365 int _bak_ActualSlice2;
00366
00367 int _given_points;
00368 int _typ;
00369 int _actual_actor;
00370 int _perpe;
00371 int _shown;
00372 int _quant_shown;
00373 int _show_rings;
00374 int _show_hs;
00375 int _showS;
00376
00377 int _first_quant;
00378 int _last_quant;
00379 int _first_point_quant;
00380 int _last_point_quant;
00381 int _bounds;
00382 int _intRange;
00383 int _nClicks;
00384 int _quantifing;
00385 int _sizeHealthyRegion;
00386
00387 int _initX;
00388 int _initY;
00389 int _initWindow;
00390 int _initLevel;
00391
00392
00393
00394
00395 float _actual_area;
00396 float _actual_peri;
00397 float _actual_darea;
00398 float _actual_dperi;
00399 float _actual_dmax;
00400 float _actual_dmin;
00401 float _actual_davg;
00402 float _actual_sten;
00403 float _actual_partial;
00404 float _actual_total;
00405 float _ip[3], _fp[3];
00406
00407
00408 wxList *_rings_index;
00409 wxList *_quant_sten;
00410 wxList *_man_points;
00411 wxList *_actual_quant_x;
00412 wxList *_actual_quant_area;
00413 wxList *_actual_quant_peri;
00414 wxList *_actual_quant_darea;
00415 wxList *_actual_quant_dperi;
00416 wxList *_actual_quant_dmax;
00417 wxList *_actual_quant_dmin;
00418 wxList *_actual_quant_davg;
00419 wxList *_actual_quant_sten;
00420
00421 DECLARE_EVENT_TABLE( );
00422
00423 void Reset_sl_Slider();
00424 void showVariables();
00425 wxString strStenosis(double stenosis);
00426 double doubleStenosis(double healthy, double sick);
00427 double GetStenosisArea(int sickSlice);
00428 double GetStenosisDiameter(int sickSlice);
00429 wxWindow* CreateView2DPanel(wxWindow *parent);
00430 void CreateManualContours();
00431 void addManualContours(int type);
00432
00433 wxSplitterWindow *_splitPanelPrincipal;
00434 wxSplitterWindow *_splitpanel_left;
00435 wxSplitterWindow *_splitpanel_right;
00436 wxSplitterWindow *_splitpanel_right_down;
00437
00438 wxWindow* CreatePanelPrincipal(wxWindow *parent);
00439 wxWindow* CreatePanelStatus(wxWindow *parent);
00440 wxWindow* CreatePanel_Left(wxWindow *parent);
00441 wxWindow* CreatePanel_Right(wxWindow *parent);
00442 wxWindow* CreateStenosisPanel(wxWindow *parent);
00443 wxWindow* CreateControlPanel3D(wxWindow *parent);
00444 wxWindow* CreatePanel_Right_Down(wxWindow *parent);
00445
00446 };
00447
00448
00449
00450
00451 #endif // __WX__MARACAS__QUANTIF__CT__WDG__HXX__
00452