VTK  9.3.0
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
24 #ifndef vtkWindowLevelLookupTable_h
25 #define vtkWindowLevelLookupTable_h
26 
27 #include "vtkLookupTable.h"
28 #include "vtkRenderingCoreModule.h" // For export macro
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
32 {
33 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
42  void ForceBuild() override;
43 
45 
49  void SetWindow(double window)
50  {
51  if (window < 1e-5)
52  {
53  window = 1e-5;
54  }
55  this->Window = window;
56  this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
57  }
58  vtkGetMacro(Window, double);
60 
62 
66  void SetLevel(double level)
67  {
68  this->Level = level;
69  this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
70  }
71  vtkGetMacro(Level, double);
73 
75 
80  vtkGetMacro(InverseVideo, vtkTypeBool);
81  vtkBooleanMacro(InverseVideo, vtkTypeBool);
83 
85 
90  vtkSetVector4Macro(MinimumTableValue, double);
91  vtkGetVector4Macro(MinimumTableValue, double);
93 
95 
100  vtkSetVector4Macro(MaximumTableValue, double);
101  vtkGetVector4Macro(MaximumTableValue, double);
103 
104 protected:
105  vtkWindowLevelLookupTable(int sze = 256, int ext = 256);
106  ~vtkWindowLevelLookupTable() override = default;
107 
108  double Window;
109  double Level;
111  double MaximumTableValue[4];
112  double MinimumTableValue[4];
113 
114 private:
116  void operator=(const vtkWindowLevelLookupTable&) = delete;
117 };
118 
119 VTK_ABI_NAMESPACE_END
120 #endif
a simple class to control print indentation
Definition: vtkIndent.h:29
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.
static vtkWindowLevelLookupTable * New()
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.
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:395
int vtkTypeBool
Definition: vtkABI.h:64