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 "vtkRenderingCoreModule.h" // For export macro
39 #include "vtkLookupTable.h"
40 
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
50  void Build();
51 
53 
55  void SetWindow(double window) {
56  if (window < 1e-5) { window = 1e-5; }
57  this->Window = window;
58  this->SetTableRange(this->Level - this->Window/2.0,
59  this->Level + this->Window/2.0); };
60  vtkGetMacro(Window,double);
62 
64 
66  void SetLevel(double level) {
67  this->Level = level;
68  this->SetTableRange(this->Level - this->Window/2.0,
69  this->Level + this->Window/2.0); };
70  vtkGetMacro(Level,double);
72 
74 
76  void SetInverseVideo(int iv);
77  vtkGetMacro(InverseVideo,int);
78  vtkBooleanMacro(InverseVideo,int);
80 
82 
85  vtkSetVector4Macro(MinimumTableValue,double);
86  vtkGetVector4Macro(MinimumTableValue,double);
88 
90 
93  vtkSetVector4Macro(MaximumTableValue,double);
94  vtkGetVector4Macro(MaximumTableValue,double);
96 
97 protected:
98  vtkWindowLevelLookupTable(int sze=256, int ext=256);
100 
101  double Window;
102  double Level;
104  double MaximumTableValue[4];
105  double MinimumTableValue[4];
106 private:
107  vtkWindowLevelLookupTable(const vtkWindowLevelLookupTable&); // Not implemented.
108  void operator=(const vtkWindowLevelLookupTable&); // Not implemented.
109 };
110 
111 #endif
void SetTableRange(double r[2])
map scalar values into colors via a lookup table
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
static vtkLookupTable * New()
virtual void Build()
#define VTKRENDERINGCORE_EXPORT
map scalar values into colors or colors to scalars; generate color table