VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkWindowLevelLookupTable.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00035 #ifndef vtkWindowLevelLookupTable_h 00036 #define vtkWindowLevelLookupTable_h 00037 00038 #include "vtkRenderingCoreModule.h" // For export macro 00039 #include "vtkLookupTable.h" 00040 00041 class VTKRENDERINGCORE_EXPORT vtkWindowLevelLookupTable : public vtkLookupTable 00042 { 00043 public: 00044 static vtkWindowLevelLookupTable *New(); 00045 vtkTypeMacro(vtkWindowLevelLookupTable,vtkLookupTable); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00050 void Build(); 00051 00053 00055 void SetWindow(double window) { 00056 if (window < 1e-5) { window = 1e-5; } 00057 this->Window = window; 00058 this->SetTableRange(this->Level - this->Window/2.0, 00059 this->Level + this->Window/2.0); }; 00060 vtkGetMacro(Window,double); 00062 00064 00066 void SetLevel(double level) { 00067 this->Level = level; 00068 this->SetTableRange(this->Level - this->Window/2.0, 00069 this->Level + this->Window/2.0); }; 00070 vtkGetMacro(Level,double); 00072 00074 00076 void SetInverseVideo(int iv); 00077 vtkGetMacro(InverseVideo,int); 00078 vtkBooleanMacro(InverseVideo,int); 00080 00082 00085 vtkSetVector4Macro(MinimumTableValue,double); 00086 vtkGetVector4Macro(MinimumTableValue,double); 00088 00090 00093 vtkSetVector4Macro(MaximumTableValue,double); 00094 vtkGetVector4Macro(MaximumTableValue,double); 00096 00097 protected: 00098 vtkWindowLevelLookupTable(int sze=256, int ext=256); 00099 ~vtkWindowLevelLookupTable() {} 00100 00101 double Window; 00102 double Level; 00103 int InverseVideo; 00104 double MaximumTableValue[4]; 00105 double MinimumTableValue[4]; 00106 private: 00107 vtkWindowLevelLookupTable(const vtkWindowLevelLookupTable&); // Not implemented. 00108 void operator=(const vtkWindowLevelLookupTable&); // Not implemented. 00109 }; 00110 00111 #endif