Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkLookupTable.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef mitkLookupTable_h
17 #define mitkLookupTable_h
18 
19 #include "mitkCommon.h"
20 #include <MitkCoreExports.h>
21 
22 #include <itkDataObject.h>
23 #include <itkObjectFactory.h>
24 
25 #include <vtkLookupTable.h>
26 #include <vtkSmartPointer.h>
27 
28 class vtkColorTransferFunction;
29 class vtkPiecewiseFunction;
30 
31 namespace mitk
32 {
46  class MITKCORE_EXPORT LookupTable : public itk::DataObject
47  {
48  public:
52  typedef unsigned char RawLookupTableType;
53 
55 
56  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
57 
61  virtual vtkSmartPointer<vtkLookupTable> GetVtkLookupTable() const;
62 
66  virtual RawLookupTableType *GetRawLookupTable() const;
67 
72  virtual void SetVtkLookupTable(vtkSmartPointer<vtkLookupTable> lut);
73 
78  virtual void ChangeOpacityForAll(float opacity);
79 
85  virtual void ChangeOpacity(int index, float opacity);
86 
94  virtual void GetColor(double value, double rgb[3]);
95 
101  virtual void GetTableValue(int index, double rgba[4]);
102 
108  virtual void SetTableValue(int index, double rgba[4]);
109 
110  itkSetMacro(Window, float);
111  itkSetMacro(Level, float);
112  itkSetMacro(Opacity, float);
113 
117  virtual bool operator==(const mitk::LookupTable &LookupTable) const;
118 
122  virtual bool operator!=(const LookupTable &LookupTable) const;
123 
128  virtual LookupTable &operator=(const LookupTable &LookupTable);
129 
134  virtual void UpdateOutputInformation() override;
135 
142  virtual void SetRequestedRegionToLargestPossibleRegion() override;
143 
148  virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
149 
155  virtual bool VerifyRequestedRegion() override;
156 
161  virtual void SetRequestedRegion(const itk::DataObject *data) override;
162 
163  LookupTable();
164  virtual ~LookupTable();
168  DEPRECATED(void CreateColorTransferFunction(vtkColorTransferFunction *&colorFunction));
172  DEPRECATED(void CreateOpacityTransferFunction(vtkPiecewiseFunction *&opacityFunction));
176  DEPRECATED(void CreateGradientTransferFunction(vtkPiecewiseFunction *&gradientFunction));
177 
178  vtkSmartPointer<vtkColorTransferFunction> CreateColorTransferFunction();
179  vtkSmartPointer<vtkPiecewiseFunction> CreateOpacityTransferFunction();
180  vtkSmartPointer<vtkPiecewiseFunction> CreateGradientTransferFunction();
181 
201  {
211  PET_20
212  };
213 
214  static const char *const typenameList[];
215 
221  virtual void SetType(const LookupTableType type);
222 
228  virtual void SetType(const std::string &typeName);
229 
233  virtual const std::string GetActiveTypeAsString();
234 
235  protected:
236  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
237 
238  LookupTable(const LookupTable &other);
239 
240  virtual void BuildGrayScaleLookupTable();
241  virtual void BuildLegacyBinaryLookupTable();
242  virtual void BuildLegacyRainbowColorLookupTable();
243  virtual void BuildInverseGrayScaleLookupTable();
244  virtual void BuildHotIronLookupTable();
245  virtual void BuildJetLookupTable(bool transparent = false);
246  virtual void BuildPETColorLookupTable();
247  virtual void BuildPET20LookupTable();
248  virtual void BuildMultiLabelLookupTable();
249 
250  vtkSmartPointer<vtkLookupTable> m_LookupTable;
251 
252  float m_Window;
253 
254  float m_Level;
255 
256  float m_Opacity;
257 
259 
260  private:
261  virtual itk::LightObject::Pointer InternalClone() const override;
262  };
263 } // namespace mitk
264 
265 #endif /* mitkLookupTable_h */
itk::SmartPointer< Self > Pointer
#define MITKCORE_EXPORT
LookupTableType
The LookupTableType enum for different predefined lookup tables.
DataCollection - Class to facilitate loading/accessing structured data.
#define DEPRECATED(func)
Definition: mitkCommon.h:183
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
LookupTableType m_type
vtkSmartPointer< vtkLookupTable > m_LookupTable
unsigned char RawLookupTableType
RawLookupTableType raw lookuptable typedef for convenience.
The LookupTable class mitk wrapper for a vtkLookupTableThis class can be used to color images with a ...