2 #ifndef __HISTOGRAMSDIALOG__
3 #define __HISTOGRAMSDIALOG__
6 // ----------------------------------------------------------------------------
7 // wx headers inclusion.
8 // For compilers that support precompilation, includes <wx/wx.h>.
9 // ----------------------------------------------------------------------------
10 #include <wx/wxprec.h>
18 //---------------------
20 //----------------------
21 #include "HistogramWidget.h"
22 #include "vtkImageData.h"
24 #include <vtkPiecewiseFunction.h>
25 #include <vtkColorTransferFunction.h>
26 #include <vtkVolumeRayCastMapper.h>
27 #include <vtkVolume.h>
28 #include "../wxMPRWidget.h"
30 class HistogramDialog:public wxDialog
36 HistogramDialog(wxWindow *parent,wxString title,vtkImageData* imageData,int type);
41 get number of points of the transference function
43 int getSizeTransferenceFunction();
45 get number of points of the barColor
47 int getSizeBarColor();
49 get a point of the transference function
51 void getTransferenceFunctionPoint(int index,int& x,int& y);
53 get a color int the bqr color
55 void getDataBarColorPoint(int index,int&x, int& red,int& green,int& blue);
57 get a point of the Histogram
60 int getHistogramPoint(int gValue);
62 //--------------------
64 //---------------------
66 Get the porcentage of the positions of
67 the min,max and actual in the bar range
69 float getMaxShowedPorcentage();
70 float getMinShowedPorcentage();
71 float getActualShowedPorcentage();
73 //---------------------------------------
74 // setting data in transferences function
76 //----------------------------------------
78 Adds a point to the transference function
80 bool addPointToTransferenceFunction(double x, double y);
82 add a color point to the histogram
83 @param x the level of grey to which the color is assigned
84 @param red the level of red for the color
85 @param green the level of red for the color
86 @param blue the level of red for the color
88 bool addColorPoint(double x,int red,int green, int blue);
89 //------------------------
91 //------------------------
94 Erase all the points that are in the transference function
96 void erasePointsTransferenceFunction();
97 void eraseColorPoints();
100 //-------------------
102 void setTransferenceFunctionHasPoints(bool hasPoints);
103 void setTransferenceFunctionHasColor(bool hasColorPoints);
105 //returns if the user has pressed refresh
108 void setCTF(vtkColorTransferFunction* cf);
109 void setTF(vtkPiecewiseFunction* tf);
110 void setVolumeMapper(vtkVolumeRayCastMapper* volMapper);
111 void setVolume(vtkVolume* vol);
112 void setMPR3Dview(wxVtkMPR3DView *wxvtkmpr3Dview1);
113 void setClipping3DView(wxVtkClipping3DView *wxvtkclipping3Dview1);
115 //--------------------
116 // plotter Information
117 //---------------------
118 void updatePlotter();
120 //-----------------------
122 //-----------------------
124 void OnSaveData(wxCommandEvent& event);
125 void OnLoadData(wxCommandEvent& event);
126 void OnRefreshBtn(wxCommandEvent& event);
132 HistogramWidget* histogramW;
145 wxButton *saveDataBtn;
149 wxButton *loadDataBtn;
153 wxButton *refreshBtn;
157 // the user had pressed refresh
160 vtkColorTransferFunction *_ctfun;
161 vtkPiecewiseFunction *_tfun;
162 vtkVolumeRayCastMapper *volumeMapper;
166 wxVtkMPR3DView *wxvtkmpr3Dview;
167 wxVtkClipping3DView *wxvtkclipping3Dview;
170 // DECLARE_CLASS(HistogramDialog);
171 // any class wishing to process wxWindows events must use this macro
172 //DECLARE_EVENT_TABLE()