00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035 #ifndef __vtkWindowLevelLookupTable_h
00036 #define __vtkWindowLevelLookupTable_h
00037
00038 #include "vtkLookupTable.h"
00039
00040 class VTK_COMMON_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
00041 {
00042 public:
00043 static vtkWindowLevelLookupTable *New();
00044 vtkTypeMacro(vtkWindowLevelLookupTable,vtkLookupTable);
00045 void PrintSelf(ostream& os, vtkIndent indent);
00046
00049 void Build();
00050
00052
00054 void SetWindow(double window) {
00055 if (window < 1e-5) { window = 1e-5; }
00056 this->Window = window;
00057 this->SetTableRange(this->Level - this->Window/2.0,
00058 this->Level + this->Window/2.0); };
00059 vtkGetMacro(Window,double);
00061
00063
00065 void SetLevel(double level) {
00066 this->Level = level;
00067 this->SetTableRange(this->Level - this->Window/2.0,
00068 this->Level + this->Window/2.0); };
00069 vtkGetMacro(Level,double);
00071
00073
00075 void SetInverseVideo(int iv);
00076 vtkGetMacro(InverseVideo,int);
00077 vtkBooleanMacro(InverseVideo,int);
00079
00081
00084 vtkSetVector4Macro(MinimumTableValue,double);
00085 vtkGetVector4Macro(MinimumTableValue,double);
00087
00089
00092 vtkSetVector4Macro(MaximumTableValue,double);
00093 vtkGetVector4Macro(MaximumTableValue,double);
00095
00097
00099 VTK_LEGACY(void SetMinimumColor(int r, int g, int b, int a));
00100 VTK_LEGACY(void SetMinimumColor(const unsigned char rgba[4]));
00101 VTK_LEGACY(void GetMinimumColor(unsigned char rgba[4]));
00102 VTK_LEGACY(unsigned char *GetMinimumColor());
00104
00106
00108 VTK_LEGACY(void SetMaximumColor(int r, int g, int b, int a));
00109 VTK_LEGACY(void SetMaximumColor(const unsigned char rgba[4]));
00110 VTK_LEGACY(void GetMaximumColor(unsigned char rgba[4]));
00111 VTK_LEGACY(unsigned char *GetMaximumColor());
00113
00114 protected:
00115 vtkWindowLevelLookupTable(int sze=256, int ext=256);
00116 ~vtkWindowLevelLookupTable() {};
00117
00118 double Window;
00119 double Level;
00120 int InverseVideo;
00121 double MaximumTableValue[4];
00122 double MinimumTableValue[4];
00123 private:
00124 vtkWindowLevelLookupTable(const vtkWindowLevelLookupTable&);
00125 void operator=(const vtkWindowLevelLookupTable&);
00126 };
00127
00128 #endif
00129
00130