wxQuantificationWidgetCT.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   wxMaracas
00004   Module:    $RCSfile: wxQuantificationWidgetCT.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__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   // Constructor &  Destructor
00079   wxQuantificationWidgetCT(wxWindow* parent, wxWindowID id = -1,
00080                          const wxPoint& pos = wxDefaultPosition,
00081                          const wxSize& size = wxDefaultSize,
00082                          long style = 0/*wxScrolledWindowStyle*/,
00083                          const wxString& name = wxPanelNameStr);
00084   
00085   ~wxQuantificationWidgetCT( );
00086     
00087   // Initialize
00088 
00089 //  void Set_control( );
00090 //  void Do_layout( );
00091   void Set_Data( );
00092 
00093 //EED  void Positionate( );
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 //EED  void Refresh_Quant( );
00103   void Point_Intensity(double x, double y);
00104   void Set_plane_3D( double  x, double y );
00105   void CleanContour();
00106 
00107 
00108   //Button
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   //CheckBox
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   // RadioButton
00128   void OnGreyScale_RB(wxCommandEvent& event);
00129   void OnColor_RB(wxCommandEvent& event);
00130     
00131   //Slider
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   // App
00222   marInterfaceCT                        *_mar;
00223   
00224   // VTK
00225   vtk3DQuantSurfaceWidget       *_3DWorld;
00226 //  vtk2DQuantSliceWidget               *_2DWorld;
00227 
00228   //Visualization
00229   wxVtk2DBaseView                       *_imageviewer2D_1;
00230   vtkImageData                          *_data;
00231   vtkBaseData                           *_vtkbasedata_1;
00232 
00233 
00234   //Manual Contour Wall
00235   /*manualContourControler      *_manContourControlWall;
00236   manualContourModel            *_mContourModelWall;
00237   manualViewContour                     *_mViewContourWall;
00238 
00239   //Manual Contour Lumen
00240   manualContourControler        *_manContourControlLumen;
00241   manualContourModel            *_mContourModelLumen;
00242   manualViewContour                     *_mViewContourLumen;
00243 
00244   //Manual Contour Calc
00245   std::vector <manualContourControler *> _manContourControlCalc;
00246   std::vector <manualContourModel *> _mContourModelCalc;
00247   std::vector <manualViewContour *> _mViewContourCalc;
00248 
00249   //Manual Contour Hypo
00250   std::vector <manualContourControler *> _manContourControlHypo;
00251   std::vector <manualContourModel *> _mContourModelHypo;
00252   std::vector <manualViewContour *> _mViewContourHypo;  
00253   
00254 */
00255   std::vector <manualContourContainer *> _manContours;
00256   //Default contours, points and lines viewing
00257   ContourView                           *_contourViewer;
00258   LineView                                      *_lineViewer;
00259   PointView                                     *_pointViewer;
00260 
00261   // Chart
00262 
00263   // EED
00264   //wxChart                                     *_Chart;
00265   wxWindow                                      *_wxStenosisPanel;
00266 
00267 //  wxSplitterWindow                    *panel_splitter; 
00268 //  wxSplitterWindow                    *panel_splitter_right; 
00269 //  wxPanel                                     *panel_left;
00270 //  wxPanel                                     *panel_right_up;
00271 //  wxPanel                                     *panel_right_down;
00272 //  wxPanel                                     *panel_rightm_up;
00273 
00274   // Group button
00275   wxButton                                      *_bt_AddContour3D;
00276   wxButton                                      *_bt_CleanContour3D;
00277   wxButton                                      *_bt_CleanAllContours3D;
00278   wxButton                                      *_bt_Healthy;
00279 
00280   wxPanelControlsHealthySickSliceCT *_pl_cntlHealthySick2;
00281 
00282 
00283 //  wxButton                            *_bt_ContourCalculated;
00284 //  wxButton                            *_bt_Pause;
00285 //  wxButton                            *_bt_Delete;
00286 //  wxButton                            *_bt_Point;
00287 
00288   // Tool graph
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   // Status Text
00306 //  wxStaticText        *_st_Label0;
00307 //  wxStaticText        *_st_Value0;
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 //  wxStaticText        *_st_Label4;
00317 //  wxStaticText        *_st_Value4;
00318 //  wxStaticText        *_st_Label5;
00319 //  wxStaticText        *_st_Value5;
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 //  wxStaticText        *_st_Label9;
00327 //  wxStaticText        *_st_Value9;
00328 
00329 
00330   wxStaticText          *_st_Label100;
00331   wxStaticText          *_st_Value100;
00332   wxStaticText          *_st_Label101;
00333   wxStaticText          *_st_Value101;
00334 //  wxStaticText        *_st_Label102;
00335 //  wxStaticText        *_st_Value102;
00336 //  wxStaticText        *_st_Label103;
00337 //  wxStaticText        *_st_Value103;
00338 //  wxStaticText        *_st_Label104;
00339 //  wxStaticText        *_st_Value104;
00340 //  wxStaticText        *_st_Label105;
00341 //  wxStaticText        *_st_Value105;
00342 //  wxStaticText        *_st_Label106;
00343 //  wxStaticText        *_st_Value106;
00344 //  wxStaticText        *_st_Label107;
00345 //  wxStaticText        *_st_Value107;
00346 //  wxStaticText        *_st_Label108;
00347 //  wxStaticText        *_st_Value108;
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   // Quantification
00360   // int
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   // float
00393 //  float _real_first_point_quant;
00394 //  float _real_last_point_quant;
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   // wxList
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 

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1