NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkLookupTableContainer.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkLookupTableContainer_h
16 #define niftkLookupTableContainer_h
17 
18 #include <niftkCoreExports.h>
19 
20 #include <vtkLookupTable.h>
21 
22 #include <mitkBaseData.h>
23 
24 #include <QString>
25 
26 namespace niftk
27 {
28 
34 class NIFTKCORE_EXPORT LookupTableContainer : public mitk::BaseData
35 {
36 
37 public:
38 
39  typedef std::pair<int, QString> LabelType;
40  typedef std::vector<LabelType> LabelListType;
41 
42  mitkClassMacro(LookupTableContainer, mitk::BaseData)
43 
44 
45 
46  LookupTableContainer(const vtkLookupTable* lut);
47 
49  LookupTableContainer(const vtkLookupTable* lut, const LabelListType& labels);
50 
52  virtual ~LookupTableContainer();
53 
55  const vtkLookupTable* GetLookupTable() const { return m_LookupTable; }
56 
58  void SetOrder(int i) { m_Order = i;}
59 
61  int GetOrder() const { return m_Order; }
62 
64  void SetDisplayName(const QString s) { m_DisplayName = s; }
65 
67  QString GetDisplayName() const { return m_DisplayName; }
68 
70  void SetIsScaled(bool s) { m_IsScaled = s; }
71 
73  bool GetIsScaled() const { return m_IsScaled; }
74 
75 
77  void SetLabels(const LabelListType& labels){ m_Labels = labels; }
78 
80  LabelListType GetLabels()const { return m_Labels; }
81 
83 
84  bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
85 
86  virtual bool VerifyRequestedRegion() override { return true; }
87 
88  virtual void SetRequestedRegion(const itk::DataObject *data) override {}
89 
90 private:
91 
94 
96  void operator=(const LookupTableContainer&) {}
97 
99  const vtkLookupTable* m_LookupTable;
100 
102  int m_Order;
103 
105  bool m_IsScaled;
106 
108  QString m_DisplayName;
109 
111  LabelListType m_Labels;
112 
113 };
114 
115 }
116 
117 #endif
void SetDisplayName(const QString s)
Definition: niftkLookupTableContainer.h:64
void SetRequestedRegionToLargestPossibleRegion() override
Definition: niftkLookupTableContainer.h:82
virtual void SetRequestedRegion(const itk::DataObject *data) override
Definition: niftkLookupTableContainer.h:88
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definition: glew.h:1363
std::vector< LabelType > LabelListType
Definition: niftkLookupTableContainer.h:40
void SetOrder(int i)
Definition: niftkLookupTableContainer.h:58
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Definition: niftkLookupTableContainer.h:84
Class to contain a vtkLookupTable and to store meta-data attributes like display name, which order to display it in in GUI, etc.
Definition: niftkLookupTableContainer.h:34
std::pair< int, QString > LabelType
Definition: niftkLookupTableContainer.h:39
void SetLabels(const LabelListType &labels)
Definition: niftkLookupTableContainer.h:77
int GetOrder() const
Definition: niftkLookupTableContainer.h:61
bool GetIsScaled() const
Definition: niftkLookupTableContainer.h:73
LabelListType GetLabels() const
Definition: niftkLookupTableContainer.h:80
void SetIsScaled(bool s)
Definition: niftkLookupTableContainer.h:70
virtual bool VerifyRequestedRegion() override
Definition: niftkLookupTableContainer.h:86
GLdouble s
Definition: glew.h:1374
Definition: niftkExceptionObject.h:21
QString GetDisplayName() const
Definition: niftkLookupTableContainer.h:67