wxQuantificationWidget.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   wxMaracas
00004   Module:    $RCSfile: wxQuantificationWidget.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009/05/14 13:54:57 $
00007   Version:   $Revision: 1.1 $
00008 
00009   Copyright: (c) 2002, 2003
00010   License:
00011   
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notice for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __WX__MARACAS__QUANTIF__WDG__HXX__
00019 #define __WX__MARACAS__QUANTIF__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/marInterface.h>
00034 #include "wxQuantificationWidget_base.h"
00035 
00036 
00037 
00038 
00039 
00040 class wxQuantificationWidget : public wxQuantificationWidget_base
00041 {
00042 public:
00043 
00044   enum WidgetsIDs { 
00045     ID_QUANTIF3D = wxID_HIGHEST + 1 
00046   };
00047 
00048   enum  FunctionIDs {
00049     ID_BUTTON_CONTOUR = wxID_HIGHEST + 1,
00050     ID_BUTTON_CLEAN,
00051     ID_BUTTON_CLEAN_ALL,
00052     ID_BUTTON_SAVE_CONTOURS3D,
00053     ID_BUTTON_AUTOQUANT,
00054     ID_BUTTON_HEALTHY,
00055     ID_BUTTON_CALCULATED,
00056     ID_BUTTON_PAUSE,
00057     ID_BUTTON_DELETE,
00058     ID_BUTTON_POINT
00059   };
00060   
00061   enum  ParamIDs {
00062     ID_CHECKBOX_HEALTHY = wxID_HIGHEST + 1,
00063     ID_CHECKBOX_PERPENDICULAR,
00064     ID_CHECKBOX_VISIBLE_RINGS,
00065     ID_CHECKBOX_SHOW_SURFACE,
00066     ID_RADIOBUTTON_GREYSCALE,
00067     ID_RADIOBUTTON_COLOR,
00068     ID_SLIDER_SLICE,
00069     ID_SLIDER_SLICE22,
00070     ID_SLIDER_ISOVALUE,
00071     ID_SLIDER_OPACITY
00072 };
00073 
00074   // Constructor &  Destructor
00075   wxQuantificationWidget(wxWindow* parent, wxWindowID id = -1,
00076                          const wxPoint& pos = wxDefaultPosition,
00077                          const wxSize& size = wxDefaultSize,
00078                          long style = 0/*wxScrolledWindowStyle*/,
00079                          const wxString& name = wxPanelNameStr);
00080   
00081   ~wxQuantificationWidget( );
00082     
00083   // Initialize
00084   void Set_control( );
00085   void Do_layout( );
00086   void Set_Data( );
00087 
00088 //EED  void Positionate( );
00089   void Forget( );
00090   void Reload_Axis(bool mask, bool step);
00091   void Show_Max_Min_Diameters( );
00092   int  Back( );
00093   void AddAxisActors();
00094   void Clean3D( bool eraseAxe = false  );
00095   void ResetAxis( );
00096   virtual void RefreshAxis( );
00097 //EED  void Refresh_Quant( );
00098   void Point_Intensity(double x, double y);
00099   void Set_plane_3D( double  x, double y );
00100   void CleanContour();
00101 
00102   void OnContourWall();
00103   void OnContourLumen();
00104   void OnContourHypo();
00105   void OnContourCalc();
00106   void OnReplaceContourWall();
00107   void OnReplaceContourLumen();
00108   void OnReplaceContourHypo();
00109   void OnReplaceContourCalc();
00110   void OnSliderDiscontinuityScroll(int percentage);
00111   void OnSliderLumenPercentageScroll(int percentage);
00112   void OnSliderCalcPercentageScroll(int percentage);
00113   void OnCalibration();
00114   void OnFile();
00115   void OnShowAll(bool value); 
00116   void OnShowWall(bool value);
00117   void OnShowLumen(bool value);
00118   void OnShowCalc(bool value);
00119   void OnShowHypo(bool value);
00120 
00121   wxPanel* CreateStenosisPanel();
00122 
00123   //Button
00124   void Do_Quant( );
00125   void OnContour_BT(wxCommandEvent& event);
00126   void OnClean_BT(wxCommandEvent& event);
00127   void OnCleanAll_BT(wxCommandEvent& event);
00128   void OnSaveContours3D_BT(wxCommandEvent& event);
00129 
00130   void OnAutoQuantification_BT(wxCommandEvent& event);
00131 
00132 
00133 
00134   virtual void DetectHealthySickSlice( bool minSurf , bool maxSurf );
00135 
00136   
00137   //CheckBox
00138   void OnHealthySlice_CB(wxCommandEvent& event);
00139   void OnShowSurface_CB(wxCommandEvent& event);
00140   void OnVisibleRing_CB(wxCommandEvent& event);
00141   void OnPerpendicular_CB(wxCommandEvent& event);
00142     
00143   // RadioButton
00144   void OnGreyScale_RB(wxCommandEvent& event);
00145   void OnColor_RB(wxCommandEvent& event);
00146     
00147   //Slider
00148   void OnSliderSliceScroll(wxScrollEvent& event);
00149   void OnSliderIsovalueScroll(wxScrollEvent& event);
00150   void OnSliderOpacityScroll(wxScrollEvent& event);
00151   virtual int  GetActualSlice();
00152   virtual int  GetMaxActualSlice();
00153   virtual int  GetHealthySlice();
00154   void GetHealthySliceRange(int &healthySliceStart,int &healthySliceEnd);
00155   virtual int  GetSizeHealthyRegion();
00156   virtual void SetSizeHealthyRegion(int size);
00157   virtual void SetHealthySlice(int healthySlice=-1);    
00158 
00159   void ShowMARACASData( marInterface* mar );
00160   void CallBackOnMouseWheel( wxMouseEvent& event );
00161   void CallBackOnLeftDClick( wxMouseEvent& event );
00162 
00163   virtual void Set3DRegionSliceActor( int type, int k1,int k2 );
00164   virtual void Set3DStartRegionSliceActor( int type, int k );
00165   void Set3DEndRegionSliceActor( int type, int k );
00166 
00167   void Show3DRegionSliceActor(int type );
00168   virtual void Show3DStartRegionSliceActor(int type );
00169   void Show3DEndRegionSliceActor(int type );
00170 
00171   void Hide3DRegionSliceActor(int type );
00172   virtual void Hide3DStartRegionSliceActor(int type );
00173   virtual void Hide3DEndRegionSliceActor(int type );
00174  
00175   virtual void GetSliceLimites(int type, int &sliceStart,int &sliceEnd);
00176 
00177   int  GetAnalysisTypeStenosis();
00178   virtual void SetAnalysisTypeStenosis(int analysisTypeStenosis);
00179 
00180   void SetSlider_Isovalue_Opacity(int isovalue,int opacity);
00181   virtual void SetManualContour_2DWorld(bool ok);
00182   virtual void SetManualContour_AddPoint_2DWorld();
00183   void SetManualContour_InsertPoint_2DWorld();
00184   void SetManualContour_ErasePoint_2DWorld();
00185   void SetManualContour_MovePoint_2DWorld();
00186   virtual void SetManualContour_ReplaceContour();
00187 
00188   virtual kVolume *GetVolumeAxisExtended(int wz1,int wz2);
00189 
00190 private:
00191 
00192   // App
00193   marInterface                          *_mar;
00194   
00195   // VTK
00196   vtk3DQuantSurfaceWidget       *_3DWorld;
00197   vtk2DQuantSliceWidget         *_2DWorld;
00198 
00199   // Chart
00200 
00201   // EED
00202   //wxChart                                     *_Chart;
00203   wxPanel                                       *_wxStenosisPanel;
00204   wxSplitterWindow                      *panel_splitter; 
00205   wxSplitterWindow                      *panel_splitter_right; 
00206   wxSplitterWindow                      *panel_splitter_left; 
00207 //  wxPanel                                     *panel_left;
00208   wxPanel                                       *panel_left_up;
00209   wxPanel                                       *panel_left_down;
00210   wxPanel                                       *panel_right;
00211   wxPanel                                       *panel_right_up;
00212   wxPanel                                       *panel_right_down;
00213 
00214   // Group button
00215   wxButton                                      *_bt_AddContour3D;
00216   wxButton                                      *_bt_CleanContour3D;
00217   wxButton                                      *_bt_CleanAllContours3D;
00218   wxButton                                      *_bt_SaveContours3D;
00219   wxButton                                      *_bt_Healthy;
00220 
00221   wxPanelControlsHealthySickSlice2 *_pl_cntlHealthySick2;
00222 
00223 
00224 //  wxButton                            *_bt_ContourCalculated;
00225 //  wxButton                            *_bt_Pause;
00226 //  wxButton                            *_bt_Delete;
00227 //  wxButton                            *_bt_Point;
00228 
00229   // Tool graph
00230   wxRadioButton                         *_rb_GreyScale;
00231   wxRadioButton                         *_rb_Color;
00232 
00233   wxCheckBox                            *_cb_HealthySlice;
00234   wxCheckBox                            *_cb_Perpendicular;
00235 
00236   wxCheckBox                            *_cb_VisibleRings;
00237   wxCheckBox                            *_cb_ShowSurface;
00238   wxSlider                                      *_sl_Slice;
00239   wxSlider                                      *_sl_Isovalue;
00240   wxSlider                                      *_sl_Opacity;
00241   wxStaticText                          *_st_Slice;
00242   wxStaticText                          *_st_Isovalue;
00243   wxStaticText                          *_st_Opacity; 
00244 
00245   // Status Text
00246 //  wxStaticText        *_st_Label0;
00247 //  wxStaticText        *_st_Value0;
00248   wxStaticText          *_st_Label1;
00249   wxStaticText          *_st_Value1;
00250   wxStaticText          *_st_Label2;
00251   wxStaticText          *_st_Value2;
00252   wxStaticText          *_st_Label3;
00253   wxStaticText          *_st_Value3;
00254 //  wxStaticText        *_st_Label4;
00255 //  wxStaticText        *_st_Value4;
00256 //  wxStaticText        *_st_Label5;
00257 //  wxStaticText        *_st_Value5;
00258   wxStaticText          *_st_Label6;
00259   wxStaticText          *_st_Value6;
00260   wxStaticText          *_st_Label7;
00261   wxStaticText          *_st_Value7;
00262   wxStaticText          *_st_Label8;
00263   wxStaticText          *_st_Value8;
00264 //  wxStaticText        *_st_Label9;
00265 //  wxStaticText        *_st_Value9;
00266 
00267 
00268   wxStaticText          *_st_Label100;
00269   wxStaticText          *_st_Value100;
00270   wxStaticText          *_st_Label101;
00271   wxStaticText          *_st_Value101;
00272 //  wxStaticText        *_st_Label102;
00273 //  wxStaticText        *_st_Value102;
00274 //  wxStaticText        *_st_Label103;
00275 //  wxStaticText        *_st_Value103;
00276 //  wxStaticText        *_st_Label104;
00277 //  wxStaticText        *_st_Value104;
00278 //  wxStaticText        *_st_Label105;
00279 //  wxStaticText        *_st_Value105;
00280 //  wxStaticText        *_st_Label106;
00281 //  wxStaticText        *_st_Value106;
00282 //  wxStaticText        *_st_Label107;
00283 //  wxStaticText        *_st_Value107;
00284 //  wxStaticText        *_st_Label108;
00285 //  wxStaticText        *_st_Value108;
00286 
00287 
00288   wxStaticText          *_st_LabelRef101;
00289   wxStaticText          *_st_ValueRef101;
00290   wxStaticText          *_st_LabelRef102;
00291   wxStaticText          *_st_ValueRef102;
00292   wxStaticText          *_st_LabelRef103;
00293   wxStaticText          *_st_ValueRef103;
00294 
00295 
00296 
00297   // Quantification
00298   // int
00299   int _numpoint;
00300   int _axis_index;
00301   int _width, _height, _depth;
00302   int _bak_ActualSlice;
00303 
00304   int _given_points;
00305   int _typ;
00306   int _actual_actor;
00307   int _perpe;
00308   int _shown;
00309   int _quant_shown;
00310   int _show_rings;
00311   int _show_hs;
00312   int _showS;
00313   
00314   int _first_quant;
00315   int _last_quant;
00316   int _first_point_quant;
00317   int _last_point_quant;
00318   int _bounds;
00319   int _intRange;
00320   int _nClicks;
00321   int _quantifing;
00322   int _sizeHealthyRegion;
00323 
00324   int _initX;
00325   int _initY;
00326   int _initWindow;
00327   int _initLevel;
00328 
00329   // float
00330 //  float _real_first_point_quant;
00331 //  float _real_last_point_quant;
00332   float _actual_area;
00333   float _actual_peri;
00334   float _actual_darea;
00335   float _actual_dperi;
00336   float _actual_dmax;
00337   float _actual_dmin;
00338   float _actual_davg;
00339   float _actual_sten;
00340   float _actual_partial;
00341   float _actual_total;
00342   float _ip[3], _fp[3];
00343 
00344   // wxList
00345   wxList  *_rings_index;
00346   wxList  *_quant_sten;
00347   wxList  *_man_points;
00348   wxList  *_actual_quant_x;
00349   wxList  *_actual_quant_area;
00350   wxList  *_actual_quant_peri;
00351   wxList  *_actual_quant_darea;
00352   wxList  *_actual_quant_dperi;
00353   wxList  *_actual_quant_dmax;
00354   wxList  *_actual_quant_dmin;
00355   wxList  *_actual_quant_davg;
00356   wxList  *_actual_quant_sten;
00357 
00358   DECLARE_EVENT_TABLE( );
00359         
00360   void          MoveSlider(int actualQuant);
00361   void          Reset_sl_Slider();
00362   void          showVariables();
00363   wxString      strStenosis(double stenosis);
00364   double        doubleStenosis(double healthy, double sick);
00365   double        GetStenosisArea(int sickSlice);
00366   double        GetStenosisDiameter(int sickSlice);
00367 
00368 };
00369 
00370 #endif // __WX__MARACAS__QUANTIF__WDG
00371 

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1