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=========================================================================*/
45#ifndef vtkWindowLevelLookupTable_h
46#define vtkWindowLevelLookupTable_h
47
48#include "vtkLookupTable.h"
49#include "vtkRenderingCoreModule.h" // For export macro
50
51class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
52{
53public:
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
62 void ForceBuild() override;
63
65
69 void SetWindow(double window)
70 {
71 if (window < 1e-5)
72 {
73 window = 1e-5;
74 }
75 this->Window = window;
76 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
77 }
78 vtkGetMacro(Window, double);
80
82
86 void SetLevel(double level)
87 {
88 this->Level = level;
89 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
90 }
91 vtkGetMacro(Level, double);
93
95
100 vtkGetMacro(InverseVideo, vtkTypeBool);
101 vtkBooleanMacro(InverseVideo, vtkTypeBool);
103
105
110 vtkSetVector4Macro(MinimumTableValue, double);
111 vtkGetVector4Macro(MinimumTableValue, double);
113
115
120 vtkSetVector4Macro(MaximumTableValue, double);
121 vtkGetVector4Macro(MaximumTableValue, double);
123
124protected:
125 vtkWindowLevelLookupTable(int sze = 256, int ext = 256);
126 ~vtkWindowLevelLookupTable() override = default;
127
128 double Window;
129 double Level;
131 double MaximumTableValue[4];
132 double MinimumTableValue[4];
133
134private:
136 void operator=(const vtkWindowLevelLookupTable&) = delete;
137};
138
139#endif
a simple class to control print indentation
Definition: vtkIndent.h:43
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