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
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:
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 
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;
120  double MaximumTableValue[4];
121  double MinimumTableValue[4];
122 
123 private:
125  void operator=(const vtkWindowLevelLookupTable&) = delete;
126 };
127 
128 VTK_ABI_NAMESPACE_END
129 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
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