HistogramDialog.h
Go to the documentation of this file.00001
00002 #ifndef __HISTOGRAMSDIALOG__
00003 #define __HISTOGRAMSDIALOG__
00004
00005
00006
00007
00008
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
00020
00021 #include "HistogramWidget.h"
00022 #include "vtkImageData.h"
00023
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
00035
00036 HistogramDialog(wxWindow *parent,wxString title,vtkImageData* imageData,int type);
00037
00038
00039
00040
00041
00042
00043 int getSizeTransferenceFunction();
00044
00045
00046
00047 int getSizeBarColor();
00048
00049
00050
00051 void getTransferenceFunctionPoint(int index,int& x,int& y);
00052
00053
00054
00055 void getDataBarColorPoint(int index,int&x, int& red,int& green,int& blue);
00056
00057
00058
00059
00060 int getHistogramPoint(int gValue);
00061
00062
00063
00064
00065
00066
00067
00068
00069 float getMaxShowedPorcentage();
00070 float getMinShowedPorcentage();
00071 float getActualShowedPorcentage();
00072
00073
00074
00075
00076
00077
00078
00079
00080 bool addPointToTransferenceFunction(double x, double y);
00081
00082
00083
00084
00085
00086
00087
00088 bool addColorPoint(double x,int red,int green, int blue);
00089
00090
00091
00092
00093
00094
00095
00096 void erasePointsTransferenceFunction();
00097 void eraseColorPoints();
00098
00099
00100
00101
00102 void setTransferenceFunctionHasPoints(bool hasPoints);
00103 void setTransferenceFunctionHasColor(bool hasColorPoints);
00104
00105
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
00117
00118 void updatePlotter();
00119
00120
00121
00122
00123
00124 void OnSaveData(wxCommandEvent& event);
00125 void OnLoadData(wxCommandEvent& event);
00126 void OnRefreshBtn(wxCommandEvent& event);
00127
00128 private:
00129
00130
00131
00132 HistogramWidget* histogramW;
00133
00134
00135
00136
00137 wxButton *okBtn;
00138
00139
00140
00141 wxButton *cancelBtn;
00142
00143
00144
00145 wxButton *saveDataBtn;
00146
00147
00148
00149 wxButton *loadDataBtn;
00150
00151
00152
00153 wxButton *refreshBtn;
00154
00155
00156
00157
00158 bool refreshed;
00159
00160 vtkColorTransferFunction *_ctfun;
00161 vtkPiecewiseFunction *_tfun;
00162 vtkVolumeRayCastMapper *volumeMapper;
00163 vtkVolume *newvol;
00164
00165
00166 wxVtkMPR3DView *wxvtkmpr3Dview;
00167 wxVtkClipping3DView *wxvtkclipping3Dview;
00168
00169
00170
00171
00172
00173 };
00174
00175 #endif
00176
00177
00178