00001 00002 #ifndef __HistogramDialogComboBox__ 00003 #define __HistogramDialogComboBox__ 00004 00005 00006 // ---------------------------------------------------------------------------- 00007 // wx headers inclusion. 00008 // For compilers that support precompilation, includes <wx/wx.h>. 00009 // ---------------------------------------------------------------------------- 00010 00011 #ifdef __BORLANDC__ 00012 #pragma hdrstop 00013 #endif 00014 00015 #include <wx/wx.h> 00016 #include <vector> 00017 00018 #include "HistogramDialogComboBoxItem.h" 00019 #include <fstream> 00020 #include <wx/bmpcbox.h> 00021 #include "vtkImageData.h" 00022 00023 00024 #define FILENAME "/Data/colorsfunction.txt" 00025 00026 00027 class HistogramDialogComboBox : public wxPanel 00028 { 00029 public: 00030 /* 00031 Constructor 00032 */ 00033 HistogramDialogComboBox(wxWindow* parent); 00034 //HistogramDialogComboBox(int bar_width,int bar_height); 00035 ~HistogramDialogComboBox(); 00036 00037 void SetColors(std::vector<double> greyvect, std::vector<double> redvect, std::vector<double> greenvect, std::vector<double> bluevect); 00038 wxBitmap GetBitmap(); 00039 00040 std::vector<double> getGreyVector(){return _greyvect;} 00041 std::vector<double> getRedVector(){return _redvect;} 00042 std::vector<double> getGreenVector(){return _greenvect;} 00043 std::vector<double> getBlueVector(){return _bluevect;} 00044 00045 void OnEditBitmapCombo(wxCommandEvent& event); 00046 void OnBitmapComboItemSelected(wxCommandEvent& event); 00047 00048 void OnColorLevelChanged(wxCommandEvent& event); 00049 void OnWindowLevelChanged(wxCommandEvent& event); 00050 00051 void setImageData(vtkImageData* img); 00052 00056 void GetValuesPointsFunction(std::vector<double>& greylevel,std::vector<double>& value); 00057 00062 void GetValuesColorPointsFunction(std::vector<double>& greylevel, 00063 std::vector<double>& red, 00064 std::vector<double>& green, 00065 std::vector<double>& blue); 00066 00067 double GetWindowLevel(); 00068 double GetColorLevel(); 00069 00070 private: 00071 00072 std::vector<double> _greyvect; 00073 std::vector<double> _redvect; 00074 std::vector<double> _greenvect; 00075 std::vector<double> _bluevect; 00076 std::vector<double> _greyvecttransfer; 00077 std::vector<double> _value; 00078 vtkImageData* _img; 00079 double _maxgreyvalue; 00080 int _currentitem; 00081 00082 /* 00083 * Represents the color of the backGround. Default color is the parent color. 00084 */ 00085 00086 wxBitmapComboBox* _bitmapcombo; 00087 wxSlider* _slidercolor; 00088 wxSlider* _sliderwindowlevel; 00089 std::vector<HistogramDialogComboBoxItem*> _bitmapsitems; 00090 wxBitmap* colorBar_Bitmap; 00091 wxSizer* _bitmapsizer; 00092 00093 wxSizer* getBitmapCombo(); 00094 wxSizer* getSlidersWlCo(); 00095 wxBitmapComboBox* getBitmapComboElements(); 00096 void OnLoadComboBoxData(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename); 00097 void saveCurrentConfiguration(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename); 00098 void setSlidersValue(); 00099 00100 00101 00102 }; 00103 00104 #endif 00105 00106 00107