2 #ifndef __HistogramDialogComboBox__
3 #define __HistogramDialogComboBox__
6 // ----------------------------------------------------------------------------
7 // wx headers inclusion.
8 // For compilers that support precompilation, includes <wx/wx.h>.
9 // ----------------------------------------------------------------------------
18 #include "HistogramDialogComboBoxItem.h"
20 #include <wx/bmpcbox.h>
21 #include "vtkImageData.h"
24 #define FILENAME "/Data/colorsfunction.txt"
27 class HistogramDialogComboBox : public wxPanel
33 HistogramDialogComboBox(wxWindow* parent);
34 //HistogramDialogComboBox(int bar_width,int bar_height);
35 ~HistogramDialogComboBox();
37 void SetColors(std::vector<double> greyvect, std::vector<double> redvect, std::vector<double> greenvect, std::vector<double> bluevect);
40 std::vector<double> getGreyVector(){return _greyvect;}
41 std::vector<double> getRedVector(){return _redvect;}
42 std::vector<double> getGreenVector(){return _greenvect;}
43 std::vector<double> getBlueVector(){return _bluevect;}
45 void OnEditBitmapCombo(wxCommandEvent& event);
46 void OnBitmapComboItemSelected(wxCommandEvent& event);
48 void OnColorLevelChanged(wxCommandEvent& event);
49 void OnWindowLevelChanged(wxCommandEvent& event);
51 void setImageData(vtkImageData* img);
54 ** Returns two vectors, the grey level of the point and its value, the value is between [0,1]
56 void GetValuesPointsFunction(std::vector<double>& greylevel,std::vector<double>& value);
59 ** Returns two vectors, the grey level of the point and its value, the red, green
60 ** and blue value is between [0,1]
62 void GetValuesColorPointsFunction(std::vector<double>& greylevel,
63 std::vector<double>& red,
64 std::vector<double>& green,
65 std::vector<double>& blue);
67 double GetWindowLevel();
68 double GetColorLevel();
72 std::vector<double> _greyvect;
73 std::vector<double> _redvect;
74 std::vector<double> _greenvect;
75 std::vector<double> _bluevect;
76 std::vector<double> _greyvecttransfer;
77 std::vector<double> _value;
83 * Represents the color of the backGround. Default color is the parent color.
86 wxBitmapComboBox* _bitmapcombo;
87 wxSlider* _slidercolor;
88 wxSlider* _sliderwindowlevel;
89 std::vector<HistogramDialogComboBoxItem*> _bitmapsitems;
90 wxBitmap* colorBar_Bitmap;
91 wxSizer* _bitmapsizer;
93 wxSizer* getBitmapCombo();
94 wxSizer* getSlidersWlCo();
95 wxBitmapComboBox* getBitmapComboElements();
96 void OnLoadComboBoxData(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
97 void saveCurrentConfiguration(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
98 void setSlidersValue();