VTK
vtkWindowLevelLookupTable.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWindowLevelLookupTable.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
35 #ifndef __vtkWindowLevelLookupTable_h
36 #define __vtkWindowLevelLookupTable_h
37 
38 #include "vtkLookupTable.h"
39 
41 {
42 public:
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
49  void Build();
50 
52 
54  void SetWindow(double window) {
55  if (window < 1e-5) { window = 1e-5; }
56  this->Window = window;
57  this->SetTableRange(this->Level - this->Window/2.0,
58  this->Level + this->Window/2.0); };
59  vtkGetMacro(Window,double);
61 
63 
65  void SetLevel(double level) {
66  this->Level = level;
67  this->SetTableRange(this->Level - this->Window/2.0,
68  this->Level + this->Window/2.0); };
69  vtkGetMacro(Level,double);
71 
73 
75  void SetInverseVideo(int iv);
76  vtkGetMacro(InverseVideo,int);
77  vtkBooleanMacro(InverseVideo,int);
79 
81 
84  vtkSetVector4Macro(MinimumTableValue,double);
85  vtkGetVector4Macro(MinimumTableValue,double);
87 
89 
92  vtkSetVector4Macro(MaximumTableValue,double);
93  vtkGetVector4Macro(MaximumTableValue,double);
95 
97 
99  VTK_LEGACY(void SetMinimumColor(int r, int g, int b, int a));
100  VTK_LEGACY(void SetMinimumColor(const unsigned char rgba[4]));
101  VTK_LEGACY(void GetMinimumColor(unsigned char rgba[4]));
102  VTK_LEGACY(unsigned char *GetMinimumColor());
104 
106 
108  VTK_LEGACY(void SetMaximumColor(int r, int g, int b, int a));
109  VTK_LEGACY(void SetMaximumColor(const unsigned char rgba[4]));
110  VTK_LEGACY(void GetMaximumColor(unsigned char rgba[4]));
111  VTK_LEGACY(unsigned char *GetMaximumColor());
113 
114 protected:
115  vtkWindowLevelLookupTable(int sze=256, int ext=256);
117 
118  double Window;
119  double Level;
121  double MaximumTableValue[4];
122  double MinimumTableValue[4];
123 private:
124  vtkWindowLevelLookupTable(const vtkWindowLevelLookupTable&); // Not implemented.
125  void operator=(const vtkWindowLevelLookupTable&); // Not implemented.
126 };
127 
128 #endif
129 
130 
void SetTableRange(double r[2])
map scalar values into colors via a lookup table
a simple class to control print indentation
Definition: vtkIndent.h:37
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_COMMON_EXPORT
static vtkLookupTable * New()
virtual void Build()
map scalar values into colors or colors to scalars; generate color table