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 =========================================================================*/
36 #ifndef vtkWindowLevelLookupTable_h
37 #define vtkWindowLevelLookupTable_h
38 
39 #include "vtkRenderingCoreModule.h" // For export macro
40 #include "vtkLookupTable.h"
41 
42 class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
53  void Build();
54 
56 
60  void SetWindow(double window) {
61  if (window < 1e-5) { window = 1e-5; }
62  this->Window = window;
63  this->SetTableRange(this->Level - this->Window/2.0,
64  this->Level + this->Window/2.0); };
65  vtkGetMacro(Window,double);
67 
69 
73  void SetLevel(double level) {
74  this->Level = level;
75  this->SetTableRange(this->Level - this->Window/2.0,
76  this->Level + this->Window/2.0); };
77  vtkGetMacro(Level,double);
79 
81 
85  void SetInverseVideo(int iv);
86  vtkGetMacro(InverseVideo,int);
87  vtkBooleanMacro(InverseVideo,int);
89 
91 
96  vtkSetVector4Macro(MinimumTableValue,double);
97  vtkGetVector4Macro(MinimumTableValue,double);
99 
101 
106  vtkSetVector4Macro(MaximumTableValue,double);
107  vtkGetVector4Macro(MaximumTableValue,double);
109 
110 protected:
111  vtkWindowLevelLookupTable(int sze=256, int ext=256);
113 
114  double Window;
115  double Level;
117  double MaximumTableValue[4];
118  double MinimumTableValue[4];
119 private:
120  vtkWindowLevelLookupTable(const vtkWindowLevelLookupTable&) VTK_DELETE_FUNCTION;
121  void operator=(const vtkWindowLevelLookupTable&) VTK_DELETE_FUNCTION;
122 };
123 
124 #endif
vtkWindowLevelLookupTable::Level
double Level
Definition: vtkWindowLevelLookupTable.h:115
vtkWindowLevelLookupTable::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkWindowLevelLookupTable::Build
void Build()
Generate lookup table as a linear ramp between MinimumTableValue and MaximumTableValue.
vtkLookupTable::SetTableRange
void SetTableRange(double r[2])
Set/Get the minimum/maximum scalar values for scalar mapping.
vtkWindowLevelLookupTable::~vtkWindowLevelLookupTable
~vtkWindowLevelLookupTable()
Definition: vtkWindowLevelLookupTable.h:112
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkWindowLevelLookupTable::SetLevel
void SetLevel(double level)
Set the Level for the lookup table.
Definition: vtkWindowLevelLookupTable.h:73
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkWindowLevelLookupTable::vtkWindowLevelLookupTable
vtkWindowLevelLookupTable(int sze=256, int ext=256)
vtkLookupTable.h
vtkWindowLevelLookupTable::Window
double Window
Definition: vtkWindowLevelLookupTable.h:114
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:75
vtkWindowLevelLookupTable::InverseVideo
int InverseVideo
Definition: vtkWindowLevelLookupTable.h:116
vtkWindowLevelLookupTable
map scalar values into colors or colors to scalars; generate color table
Definition: vtkWindowLevelLookupTable.h:43
vtkWindowLevelLookupTable::SetInverseVideo
void SetInverseVideo(int iv)
Set inverse video on or off.
vtkWindowLevelLookupTable::SetWindow
void SetWindow(double window)
Set the window for the lookup table.
Definition: vtkWindowLevelLookupTable.h:60
vtkWindowLevelLookupTable::New
static vtkWindowLevelLookupTable * New()