SMILX  1.01
milxColourMap.h
1 /*=========================================================================
2  The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO)
3  ABN 41 687 119 230.
4  All rights reserved.
5 
6  Licensed under the CSIRO BSD 3-Clause License
7  You may not use this file except in compliance with the License.
8  You may obtain a copy of the License in the file LICENSE.md or at
9 
10  https://stash.csiro.au/projects/SMILI/repos/smili/browse/license.txt
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 =========================================================================*/
18 #ifndef __MILXCOLOURMAP_H
19 #define __MILXCOLOURMAP_H
20 
21 #include <vtkSmartPointer.h>
22 #include <vtkLookupTable.h>
23 
24 #include "milxGlobal.h"
25 #include "milxLUT.h"
26 
27 namespace milx
28 {
29 
50 {
51 public:
52  ColourMap();
53  ~ColourMap();
54 
55  void reset();
56 
57  enum ColourMapFlags {JET, RAINBOW, VTK, GRAY, SEISMIC, LOG_GRAY, NIH, NIH_FIRE, AAL, FS, HOT, COOL, COOLWARM, KNEE, BONE, SPECTRAL, GNUPLOT, CUBEHELIX, HSV};
58 
59  // Set map as Rainbow
60  inline void toJet()
61  { reset(); mapFlag = JET; }
62  inline void SetJet()
63  { toJet(); }
64  // Set map as Rainbow
65  inline void toRainbow()
66  { reset(); mapFlag = RAINBOW; }
67  inline void SetRainbow()
68  { toRainbow(); }
69  // Set map as Inverse Rainbow
70  inline void toVTK()
71  { reset(); mapFlag = VTK; }
72  inline void SetVTK()
73  { toVTK(); }
74  // Set map as Gray
75  inline void toGray()
76  { reset(); mapFlag = GRAY; }
77  inline void SetGray()
78  { toGray(); }
79  // Set map as Seismic
80  inline void toSeismic()
81  { reset(); mapFlag = SEISMIC; }
82  inline void SetSeismic()
83  { toSeismic(); }
84  // Set map as Log Gray
85  inline void toLogGray()
86  { reset(); mapFlag = LOG_GRAY; }
87  inline void SetLogGray()
88  { toLogGray(); }
89  // Set map as NIH
90  inline void toNIH()
91  { reset(); mapFlag = NIH; }
92  inline void SetNIH()
93  { toNIH(); }
94  //Set Map as NIH FIRE
95  inline void toNIH_FIRE()
96  { reset(); mapFlag = NIH_FIRE; }
97  inline void SetNIH_FIRE()
98  { toNIH_FIRE(); }
99  //Set Map as AAL
100  inline void toAAL()
101  { reset(); mapFlag = AAL; }
102  inline void SetAAL()
103  { toAAL(); }
104  //Set Map as FS (free surfer)
105  inline void toFS()
106  { reset(); mapFlag = FS; }
107  inline void SetFS()
108  { toFS(); }
109  //Set Map as HOT
110  inline void toHOT()
111  { reset(); mapFlag = HOT; }
112  inline void SetHOT()
113  { toHOT(); }
114  //Set Map as HOT
115  inline void toCOOL()
116  { reset(); mapFlag = COOL; }
117  inline void SetCOOL()
118  { toCOOL(); }
119  //Set Map as HOT
120  inline void toCOOLWARM()
121  { reset(); mapFlag = COOLWARM; }
122  inline void SetCOOLWARM()
123  { toCOOLWARM(); }
124  //Set Map as HOT
125  inline void toKnee()
126  { reset(); mapFlag = KNEE; }
127  inline void SetKnee()
128  { toKnee(); }
129  //Set Map as Bone
130  inline void toBone()
131  { reset(); mapFlag = BONE; }
132  inline void SetBone()
133  { toBone(); }
134  //Set Map as Spectral
135  inline void toSpectral()
136  { reset(); mapFlag = SPECTRAL; }
137  inline void SetSpectral()
138  { toSpectral(); }
139  //Set Map as GNUPlot
140  inline void toGNUPlot()
141  { reset(); mapFlag = GNUPLOT; }
142  inline void SetGNUPlot()
143  { toGNUPlot(); }
144  //Set Map as CubeHelix
145  inline void toCubeHelix()
146  { reset(); mapFlag = CUBEHELIX; }
147  inline void SetCubeHelix()
148  { toCubeHelix(); }
149  //Set Map as HSV
150  inline void toHSV()
151  { reset(); mapFlag = HSV; }
152  inline void SetHSV()
153  { toHSV(); }
154 
155  inline void SetRange(double range[2])
156  {
157  mapRange[0] = range[0];
158  mapRange[1] = range[1];
159  }
160  inline double* GetRange()
161  { return &mapRange[0]; }
162 
166  vtkSmartPointer<vtkLookupTable> GetOutput();
167 
168 protected:
169  //Flags
170  ColourMapFlags mapFlag;
171  bool generated;
172 
173  void GenerateData();
174 
175  coordinateType mapRange[2];
176 
177  //Lookup table for map
178  vtkSmartPointer<vtkLookupTable> lookupTable;
179 };
180 
181 } //end namespace
182 
183 #endif //__MILXCOLOURMAP_H
#define SMILI_EXPORT
DLL Function Symbol for Windows. It is empty for other OSes.
Definition: milxGlobal.h:227
Represents a the various colour maps available for VTK scalars etc. Default: NIH. ...
Definition: milxColourMap.h:49