VTK  9.4.20241031
vtkWindowLevelLookupTable.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
63#ifndef vtkWindowLevelLookupTable_h
64#define vtkWindowLevelLookupTable_h
65
66#include "vtkLookupTable.h"
67#include "vtkRenderingCoreModule.h" // For export macro
68
69VTK_ABI_NAMESPACE_BEGIN
70class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
71{
72public:
75 void PrintSelf(ostream& os, vtkIndent indent) override;
76
81 void ForceBuild() override;
82
84
88 void SetWindow(double window)
89 {
90 if (window < 1e-5)
91 {
92 window = 1e-5;
93 }
94 this->Window = window;
95 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
96 }
97 vtkGetMacro(Window, double);
99
101
105 void SetLevel(double level)
106 {
107 this->Level = level;
108 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
109 }
110 vtkGetMacro(Level, double);
112
114
119 vtkGetMacro(InverseVideo, vtkTypeBool);
120 vtkBooleanMacro(InverseVideo, vtkTypeBool);
122
124
129 vtkSetVector4Macro(MinimumTableValue, double);
130 vtkGetVector4Macro(MinimumTableValue, double);
132
134
139 vtkSetVector4Macro(MaximumTableValue, double);
140 vtkGetVector4Macro(MaximumTableValue, double);
142
143protected:
144 vtkWindowLevelLookupTable(int sze = 256, int ext = 256);
145 ~vtkWindowLevelLookupTable() override = default;
146
147 double Window;
148 double Level;
150 double MaximumTableValue[4];
151 double MinimumTableValue[4];
152
153private:
155 void operator=(const vtkWindowLevelLookupTable&) = delete;
156};
157
158VTK_ABI_NAMESPACE_END
159#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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.
int vtkTypeBool
Definition vtkABI.h:64