Medical Imaging Interaction Toolkit  2018.4.99-4c24e3cb
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef mitkLookupTable_h
13 #define mitkLookupTable_h
14 
15 #include "mitkCommon.h"
16 #include <MitkCoreExports.h>
17 
18 #include <itkDataObject.h>
19 #include <itkObjectFactory.h>
20 
21 #include <vtkLookupTable.h>
22 #include <vtkSmartPointer.h>
23 
24 class vtkColorTransferFunction;
25 class vtkPiecewiseFunction;
26 
27 namespace mitk
28 {
42  class MITKCORE_EXPORT LookupTable : public itk::DataObject
43  {
44  public:
48  typedef unsigned char RawLookupTableType;
49 
51 
52  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
53 
54 
57  virtual vtkSmartPointer<vtkLookupTable> GetVtkLookupTable() const;
58 
62  virtual RawLookupTableType *GetRawLookupTable() const;
63 
68  virtual void SetVtkLookupTable(vtkSmartPointer<vtkLookupTable> lut);
69 
74  virtual void ChangeOpacityForAll(float opacity);
75 
81  virtual void ChangeOpacity(int index, float opacity);
82 
90  virtual void GetColor(double value, double rgb[3]);
91 
97  virtual void GetTableValue(int index, double rgba[4]);
98 
104  virtual void SetTableValue(int index, double rgba[4]);
105 
106  itkSetMacro(Window, float);
107  itkSetMacro(Level, float);
108  itkSetMacro(Opacity, float);
109 
113  virtual bool operator==(const mitk::LookupTable &LookupTable) const;
114 
118  virtual bool operator!=(const LookupTable &LookupTable) const;
119 
124  virtual LookupTable &operator=(const LookupTable &LookupTable);
125 
130  void UpdateOutputInformation() override;
131 
138  void SetRequestedRegionToLargestPossibleRegion() override;
139 
144  bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
145 
151  bool VerifyRequestedRegion() override;
152 
157  void SetRequestedRegion(const itk::DataObject *data) override;
158 
159  LookupTable();
160  ~LookupTable() override;
164  DEPRECATED(void CreateColorTransferFunction(vtkColorTransferFunction *&colorFunction));
168  DEPRECATED(void CreateOpacityTransferFunction(vtkPiecewiseFunction *&opacityFunction));
172  DEPRECATED(void CreateGradientTransferFunction(vtkPiecewiseFunction *&gradientFunction));
173 
174  vtkSmartPointer<vtkColorTransferFunction> CreateColorTransferFunction();
175  vtkSmartPointer<vtkPiecewiseFunction> CreateOpacityTransferFunction();
176  vtkSmartPointer<vtkPiecewiseFunction> CreateGradientTransferFunction();
177 
197  {
211  PET_20
212  };
213 
214  static std::vector<std::string> typenameList;
215 
221  virtual void SetType(const LookupTableType type);
222 
228  virtual void SetType(const std::string &typeName);
229 
233  virtual LookupTableType GetActiveType() const;
234 
238  virtual std::string GetActiveTypeAsString() const;
239 
240  protected:
241  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
242 
243  LookupTable(const LookupTable &other);
244 
245  virtual void BuildGrayScaleLookupTable();
246  virtual void BuildLegacyBinaryLookupTable();
247  virtual void BuildLegacyRainbowColorLookupTable();
248  virtual void BuildInverseGrayScaleLookupTable();
249  virtual void BuildHotIronLookupTable();
250  virtual void BuildPlasmaLookupTable();
251  virtual void BuildInfernoLookupTable();
252  virtual void BuildViridisLookupTable();
253  virtual void BuildMagmaLookupTable();
254  virtual void BuildJetLookupTable(bool transparent = false);
255  virtual void BuildPETColorLookupTable();
256  virtual void BuildPET20LookupTable();
257  virtual void BuildMultiLabelLookupTable();
258 
259  vtkSmartPointer<vtkLookupTable> m_LookupTable;
260 
261  float m_Window;
262  float m_Level;
263  float m_Opacity;
264 
266 
267  private:
268  itk::LightObject::Pointer InternalClone() const override;
269  };
270 } // namespace mitk
271 
272 #endif /* mitkLookupTable_h */
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
#define MITKCORE_EXPORT
LookupTableType
The LookupTableType enum for different predefined lookup tables.
static std::vector< std::string > typenameList
DataCollection - Class to facilitate loading/accessing structured data.
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
#define DEPRECATED(func)
Definition: mitkCommon.h:179
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
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 ...