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 =========================================================================*/
36 #ifndef vtkWindowLevelLookupTable_h
37 #define vtkWindowLevelLookupTable_h
38 
39 #include "vtkLookupTable.h"
40 #include "vtkRenderingCoreModule.h" // For export macro
41 
42 class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53  void ForceBuild() override;
54 
56 
60  void SetWindow(double window)
61  {
62  if (window < 1e-5)
63  {
64  window = 1e-5;
65  }
66  this->Window = window;
67  this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
68  }
69  vtkGetMacro(Window, double);
71 
73 
77  void SetLevel(double level)
78  {
79  this->Level = level;
80  this->SetTableRange(this->Level - this->Window / 2.0, this->Level + this->Window / 2.0);
81  }
82  vtkGetMacro(Level, double);
84 
86 
91  vtkGetMacro(InverseVideo, vtkTypeBool);
92  vtkBooleanMacro(InverseVideo, vtkTypeBool);
94 
96 
101  vtkSetVector4Macro(MinimumTableValue, double);
102  vtkGetVector4Macro(MinimumTableValue, double);
104 
106 
111  vtkSetVector4Macro(MaximumTableValue, double);
112  vtkGetVector4Macro(MaximumTableValue, double);
114 
115 protected:
116  vtkWindowLevelLookupTable(int sze = 256, int ext = 256);
117  ~vtkWindowLevelLookupTable() override = default;
118 
119  double Window;
120  double Level;
122  double MaximumTableValue[4];
123  double MinimumTableValue[4];
124 
125 private:
127  void operator=(const vtkWindowLevelLookupTable&) = delete;
128 };
129 
130 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
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:401
int vtkTypeBool
Definition: vtkABI.h:69