HistogramDialog.h

Go to the documentation of this file.
00001 
00002 #ifndef __HISTOGRAMSDIALOG__
00003 #define __HISTOGRAMSDIALOG__
00004 
00005 
00006 // ----------------------------------------------------------------------------
00007 // wx headers inclusion.
00008 // For compilers that support precompilation, includes <wx/wx.h>.
00009 // ----------------------------------------------------------------------------
00010 #include <wx/wxprec.h>
00011 #ifdef __BORLANDC__
00012 #pragma hdrstop
00013 #endif
00014 #ifndef WX_PRECOMP
00015 #include <wx/wx.h>
00016 #endif
00017 
00018  //---------------------
00019  // Includes
00020  //----------------------
00021  #include "HistogramWidget.h"
00022  #include "vtkImageData.h"      
00023  //#include <vector>
00024  #include <vtkPiecewiseFunction.h>
00025  #include <vtkColorTransferFunction.h>
00026  #include <vtkVolumeRayCastMapper.h>
00027  #include <vtkVolume.h>
00028  #include "../wxMPRWidget.h"
00029 
00030 class HistogramDialog:public wxDialog
00031 {
00032 public:
00033         /*
00034          Constructor
00035         */
00036         HistogramDialog(wxWindow *parent,wxString title,vtkImageData* imageData,int type);
00037         /*
00038          Methods
00039         */
00040         /*
00041                 get number of points of the transference function
00042         */
00043         int getSizeTransferenceFunction();
00044         /*
00045                 get number of points of the barColor
00046         */
00047         int getSizeBarColor();
00048         /*
00049                 get a point of the transference function
00050         */
00051         void getTransferenceFunctionPoint(int index,int& x,int& y);
00052         /*
00053                 get a  color int the bqr color
00054         */
00055         void getDataBarColorPoint(int index,int&x, int& red,int& green,int& blue);
00056         /*
00057                 get a point of the Histogram
00058                 given the grey value
00059         */
00060         int getHistogramPoint(int gValue);
00061 
00062         //--------------------
00063         // bar Information
00064         //---------------------
00065         /*
00066          Get the porcentage of the positions of 
00067          the min,max and actual in the bar range
00068         */
00069         float getMaxShowedPorcentage();
00070         float getMinShowedPorcentage(); 
00071         float getActualShowedPorcentage();
00072 
00073         //---------------------------------------
00074         // setting data in transferences function
00075         // and in bar color
00076         //----------------------------------------
00077         /*
00078           Adds a point to the transference function
00079         */
00080         bool addPointToTransferenceFunction(double x, double y);
00081         /*
00082                 add a color point to the histogram
00083                 @param x the level of grey to which the color is assigned
00084                 @param red the level of red for the color
00085                 @param green the level of red for the color
00086                 @param blue the level of red for the color
00087         */
00088         bool addColorPoint(double x,int red,int green, int blue);
00089         //------------------------
00090         //Erase data
00091         //------------------------
00092         
00093         /*
00094          Erase all the points that are in the transference function
00095         */
00096         void erasePointsTransferenceFunction();
00097         void eraseColorPoints();
00098         //-------------------
00099         // Getter and setters
00100         //-------------------
00101 
00102         void setTransferenceFunctionHasPoints(bool hasPoints);
00103         void setTransferenceFunctionHasColor(bool hasColorPoints);
00104         
00105         //returns if the user has pressed refresh       
00106         
00107         bool getRefreshed();
00108         void setCTF(vtkColorTransferFunction* cf);
00109         void setTF(vtkPiecewiseFunction* tf);
00110         void setVolumeMapper(vtkVolumeRayCastMapper* volMapper);
00111         void setVolume(vtkVolume* vol);
00112         void setMPR3Dview(wxVtkMPR3DView *wxvtkmpr3Dview1);
00113         void setClipping3DView(wxVtkClipping3DView *wxvtkclipping3Dview1);
00114 
00115         //--------------------
00116         // plotter Information
00117         //---------------------
00118         void updatePlotter();
00119         
00120         //-----------------------
00121         //Handling events
00122         //-----------------------
00123 
00124         void OnSaveData(wxCommandEvent& event);
00125         void OnLoadData(wxCommandEvent& event);
00126         void OnRefreshBtn(wxCommandEvent& event);
00127         
00128 private:
00129         /*
00130         Histogram Widget
00131         */
00132         HistogramWidget*  histogramW;
00133 
00134         /*
00135          ok Button
00136         */
00137         wxButton                *okBtn;
00138         /*
00139          cancel Button
00140         */
00141         wxButton                *cancelBtn;
00142         /*
00143          save Button
00144         */
00145         wxButton                *saveDataBtn;   
00146         /*
00147         Load Button
00148         */
00149         wxButton                *loadDataBtn;
00150         /*
00151         Refresh Button
00152         */
00153         wxButton                *refreshBtn;
00154 
00155         
00156         
00157         // the user had pressed refresh
00158         bool refreshed;
00159         
00160         vtkColorTransferFunction                        *_ctfun;
00161         vtkPiecewiseFunction                            *_tfun;
00162         vtkVolumeRayCastMapper                          *volumeMapper; 
00163         vtkVolume                                                       *newvol;
00164 
00165         //things to refresh
00166         wxVtkMPR3DView                                          *wxvtkmpr3Dview;
00167         wxVtkClipping3DView                                     *wxvtkclipping3Dview;
00168         
00169         
00170 //      DECLARE_CLASS(HistogramDialog);
00171         // any class wishing to process wxWindows events must use this macro
00172         //DECLARE_EVENT_TABLE()
00173 };
00174 
00175 #endif
00176 
00177 
00178 

Generated on Fri Jun 12 00:08:33 2009 for creaMaracasVisu by  doxygen 1.5.7.1