VTK  9.1.0
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=========================================================================*/
75#ifndef vtkWindowLevelLookupTable_h
76#define vtkWindowLevelLookupTable_h
77
78#include "vtkLookupTable.h"
79#include "vtkRenderingCoreModule.h" // For export macro
80
81class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
82{
83public:
86 void PrintSelf(ostream& os, vtkIndent indent) override;
87
92 void ForceBuild() override;
93
95
99 void SetWindow(double window)
100 {
101 if (window < 1e-5)
102 {
103 window = 1e-5;
104 }
105 this->Window = window;
106 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
107 }
108 vtkGetMacro(Window, double);
110
112
116 void SetLevel(double level)
117 {
118 this->Level = level;
119 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
120 }
121 vtkGetMacro(Level, double);
123
125
130 vtkGetMacro(InverseVideo, vtkTypeBool);
131 vtkBooleanMacro(InverseVideo, vtkTypeBool);
133
135
140 vtkSetVector4Macro(MinimumTableValue, double);
141 vtkGetVector4Macro(MinimumTableValue, double);
143
145
150 vtkSetVector4Macro(MaximumTableValue, double);
151 vtkGetVector4Macro(MaximumTableValue, double);
153
154protected:
155 vtkWindowLevelLookupTable(int sze = 256, int ext = 256);
156 ~vtkWindowLevelLookupTable() override = default;
157
158 double Window;
159 double Level;
161 double MaximumTableValue[4];
162 double MinimumTableValue[4];
163
164private:
166 void operator=(const vtkWindowLevelLookupTable&) = delete;
167};
168
169#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
map scalar values into colors via a lookup table
virtual void SetTableRange(const double r[2])
Set/Get the minimum/maximum scalar values for scalar mapping.
map scalar values into colors or colors to scalars; generate color table
~vtkWindowLevelLookupTable() override=default
void SetInverseVideo(vtkTypeBool iv)
Set inverse video on or off.
vtkWindowLevelLookupTable(int sze=256, int ext=256)
void SetLevel(double level)
Set the Level for the lookup table.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkWindowLevelLookupTable * New()
void SetWindow(double window)
Set the window for the lookup table.
void ForceBuild() override
Generate lookup table as a linear ramp between MinimumTableValue and MaximumTableValue.
@ level
Definition: vtkX3D.h:401
int vtkTypeBool
Definition: vtkABI.h:69