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"
26 #define FILENAME "~/.creaMaracasVisu/data/colorsfunction.txt"
30 class HistogramDialogComboBox : public wxPanel
36 HistogramDialogComboBox(wxWindow* parent);
37 //HistogramDialogComboBox(int bar_width,int bar_height);
38 ~HistogramDialogComboBox();
40 void SetColors(std::vector<double> greyvect, std::vector<double> redvect, std::vector<double> greenvect, std::vector<double> bluevect);
43 std::vector<double> getGreyVector(){return _greyvect;}
44 std::vector<double> getRedVector(){return _redvect;}
45 std::vector<double> getGreenVector(){return _greenvect;}
46 std::vector<double> getBlueVector(){return _bluevect;}
48 void OnEditBitmapCombo(wxCommandEvent& event);
49 void OnBitmapComboItemSelected(wxCommandEvent& event);
51 void OnColorLevelChanged(wxCommandEvent& event);
52 void OnWindowLevelChanged(wxCommandEvent& event);
54 void setImageData(vtkImageData* img);
57 ** Returns two vectors, the grey level of the point and its value, the value is between [0,1]
59 void GetValuesPointsFunction(std::vector<double>& greylevel,std::vector<double>& value);
62 ** Returns two vectors, the grey level of the point and its value, the red, green
63 ** and blue value is between [0,1]
65 void GetValuesColorPointsFunction(std::vector<double>& greylevel,
66 std::vector<double>& red,
67 std::vector<double>& green,
68 std::vector<double>& blue);
70 double GetWindowLevel();
71 double GetColorLevel();
75 std::vector<double> _greyvect;
76 std::vector<double> _redvect;
77 std::vector<double> _greenvect;
78 std::vector<double> _bluevect;
79 std::vector<double> _greyvecttransfer;
80 std::vector<double> _value;
86 * Represents the color of the backGround. Default color is the parent color.
89 wxBitmapComboBox* _bitmapcombo;
90 wxSlider* _slidercolor;
91 wxSlider* _sliderwindowlevel;
92 std::vector<HistogramDialogComboBoxItem*> _bitmapsitems;
93 wxBitmap* colorBar_Bitmap;
94 wxSizer* _bitmapsizer;
96 wxSizer* getBitmapCombo();
97 wxSizer* getSlidersWlCo();
98 wxBitmapComboBox* getBitmapComboElements();
99 void OnLoadComboBoxData(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
100 void saveCurrentConfiguration(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
101 void setSlidersValue();