VTK: Rendering/Core/vtkWindowLevelLookupTable.h Source File

| VTK 9.3.1

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
33 #ifndef vtkWindowLevelLookupTable_h
34 #define vtkWindowLevelLookupTable_h
35
36 #include "vtkLookupTable.h"
37 #include "vtkRenderingCoreModule.h" // For export macro
38
39 VTK_ABI_NAMESPACE_BEGIN
40 class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
41 {
42 public:
43 static vtkWindowLevelLookupTable* New();
44 vtkTypeMacro(vtkWindowLevelLookupTable, vtkLookupTable);
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
51 void ForceBuild() override;
52
54
58 void SetWindow(double window)
59 {
60 if (window < 1e-5)
61 {
62 window = 1e-5;
63 }
64 this->Window = window;
65 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
66 }
67 vtkGetMacro(Window, double);
69
71
75 void SetLevel(double level)
76 {
77 this->Level = level;
78 this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
79 }
80 vtkGetMacro(Level, double);
82
84
88 void SetInverseVideo(vtkTypeBool iv);
89 vtkGetMacro(InverseVideo, vtkTypeBool);
90 vtkBooleanMacro(InverseVideo, vtkTypeBool);
92
94
99 vtkSetVector4Macro(MinimumTableValue, double);
100 vtkGetVector4Macro(MinimumTableValue, double);
102
104
109 vtkSetVector4Macro(MaximumTableValue, double);
110 vtkGetVector4Macro(MaximumTableValue, double);
112
113 protected:
114 vtkWindowLevelLookupTable(int sze = 256, int ext = 256);
115 ~vtkWindowLevelLookupTable() override = default;
116
117 double Window;
118 double Level;
119 vtkTypeBool InverseVideo;
120 double MaximumTableValue[4];
121 double MinimumTableValue[4];
122
123 private:
124 vtkWindowLevelLookupTable(const vtkWindowLevelLookupTable&) = delete;
125 void operator=(const vtkWindowLevelLookupTable&) = delete;
126 };
127
128 VTK_ABI_NAMESPACE_END
129 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:73
vtkLookupTable::SetTableRange
virtual void SetTableRange(const double r[2])
Set/Get the minimum/maximum scalar values for scalar mapping.
vtkWindowLevelLookupTable
map scalar values into colors or colors to scalars; generate color table
Definition: vtkWindowLevelLookupTable.h:41
vtkWindowLevelLookupTable::~vtkWindowLevelLookupTable
~vtkWindowLevelLookupTable() override=default
vtkWindowLevelLookupTable::SetInverseVideo
void SetInverseVideo(vtkTypeBool iv)
Set inverse video on or off.
vtkWindowLevelLookupTable::New
static vtkWindowLevelLookupTable * New()
vtkWindowLevelLookupTable::Window
double Window
Definition: vtkWindowLevelLookupTable.h:117
vtkWindowLevelLookupTable::InverseVideo
vtkTypeBool InverseVideo
Definition: vtkWindowLevelLookupTable.h:119
vtkWindowLevelLookupTable::vtkWindowLevelLookupTable
vtkWindowLevelLookupTable(int sze=256, int ext=256)
vtkWindowLevelLookupTable::SetLevel
void SetLevel(double level)
Set the Level for the lookup table.
Definition: vtkWindowLevelLookupTable.h:75
vtkWindowLevelLookupTable::Level
double Level
Definition: vtkWindowLevelLookupTable.h:118
vtkWindowLevelLookupTable::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWindowLevelLookupTable::SetWindow
void SetWindow(double window)
Set the window for the lookup table.
Definition: vtkWindowLevelLookupTable.h:58
vtkWindowLevelLookupTable::ForceBuild
void ForceBuild() override
Generate lookup table as a linear ramp between MinimumTableValue and MaximumTableValue.
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkLookupTable.h