Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLColorLogic.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8 =========================================================================auto=*/
9 
10 #ifndef __vtkMRMLColorLogic_h
11 #define __vtkMRMLColorLogic_h
12 
13 // MRMLLogic includes
14 #include "vtkMRMLAbstractLogic.h"
15 #include "vtkMRMLLogicExport.h"
16 
17 // MRML includes
18 class vtkMRMLColorNode;
25 
26 // STD includes
27 #include <cstdlib>
28 #include <vector>
29 
34 class VTK_MRML_LOGIC_EXPORT vtkMRMLColorLogic : public vtkMRMLAbstractLogic
35 {
36 public:
37 
39  static vtkMRMLColorLogic *New();
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
133  virtual void AddDefaultColorNodes();
134 
138  virtual void RemoveDefaultColorNodes();
139 
141  static const char * GetColorTableNodeID(int type);
142 
144  static const char * GetFreeSurferColorNodeID(int type);
145 
147  static const char * GetdGEMRICColorNodeID(int type);
148 
150  static const char * GetPETColorNodeID(int type);
151 
155  static const char * GetProceduralColorNodeID(const char *name);
156 
161  static const char * GetFileColorNodeID(const char *fileName);
162  static std::string GetFileColorNodeSingletonTag(const char * fileName);
163 
165  virtual const char * GetDefaultFreeSurferLabelMapColorNodeID();
166 
168  virtual const char * GetDefaultVolumeColorNodeID();
169 
171  virtual const char * GetDefaultLabelMapColorNodeID();
172 
174  virtual const char * GetDefaultEditorColorNodeID();
175 
177  virtual const char * GetDefaultModelColorNodeID();
178 
180  virtual const char * GetDefaultChartColorNodeID();
181 
183  virtual const char * GetDefaultPlotColorNodeID();
184 
186  void AddColorFile(const char *fileName, std::vector<std::string> *Files);
187 
199  vtkMRMLColorNode* LoadColorFile(const char *fileName, const char *nodeName = NULL);
200 
202  vtkGetStringMacro(UserColorFilePaths);
203  vtkSetStringMacro(UserColorFilePaths);
204 
208  static vtkMRMLColorTableNode* CopyNode(vtkMRMLColorNode* colorNode, const char* copyName);
209 
215  static vtkMRMLProceduralColorNode* CopyProceduralNode(vtkMRMLColorNode* colorNode, const char* copyName);
216 
217 protected:
219  virtual ~vtkMRMLColorLogic();
220  // disable copy constructor and operator
222  void operator=(const vtkMRMLColorLogic&);
223 
225  virtual void SetMRMLSceneInternal(vtkMRMLScene* newScene) VTK_OVERRIDE;
226 
229  virtual void OnMRMLSceneNewEvent();
230 
231  vtkMRMLColorTableNode* CreateLabelsNode();
232  vtkMRMLColorTableNode* CreateDefaultTableNode(int type);
233  vtkMRMLProceduralColorNode* CreateRandomNode();
234  vtkMRMLProceduralColorNode* CreateRedGreenBlueNode();
235  vtkMRMLFreeSurferProceduralColorNode* CreateFreeSurferNode(int type);
236  vtkMRMLColorTableNode* CreateFreeSurferFileNode(const char* fileName);
237  vtkMRMLPETProceduralColorNode* CreatePETColorNode(int type);
238  vtkMRMLdGEMRICProceduralColorNode* CreatedGEMRICColorNode(int type);
239  vtkMRMLColorTableNode* CreateDefaultFileNode(const std::string& colorname);
240  vtkMRMLColorTableNode* CreateUserFileNode(const std::string& colorname);
241  vtkMRMLColorTableNode* CreateFileNode(const char* fileName);
242  vtkMRMLProceduralColorNode* CreateProceduralFileNode(const char* fileName);
243 
244  void AddLabelsNode();
245  void AddDefaultTableNode(int i);
246  void AddDefaultProceduralNodes();
247  void AddFreeSurferNode(int type);
248  void AddFreeSurferFileNode(vtkMRMLFreeSurferProceduralColorNode* basicFSNode);
249  void AddPETNode(int type);
250  void AddDGEMRICNode(int type);
251  void AddDefaultFileNode(int i);
252  void AddUserFileNode(int i);
253 
254  void AddDefaultTableNodes();
255  void AddFreeSurferNodes();
256  void AddPETNodes();
257  void AddDGEMRICNodes();
258  void AddDefaultFileNodes();
259  void AddUserFileNodes();
260 
261  virtual std::vector<std::string> FindDefaultColorFiles();
262  virtual std::vector<std::string> FindUserColorFiles();
263 
266  static const char * GetColorNodeID(vtkMRMLColorNode* colorNode);
267 
272  std::vector<std::string> ColorFiles;
273 
276  std::vector<std::string> UserColorFiles;
281 
282  static std::string TempColorNodeID;
283 
284  std::string RemoveLeadAndTrailSpaces(std::string);
285 };
286 
287 #endif
Superclass for MRML logic classes.
std::vector< std::string > UserColorFiles
std::vector< std::string > ColorFiles
MRML logic class for color manipulation.
MRML node to represent FreeSurfer color information.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
Abstract MRML node to represent color information.
MRML node to represent procedurally defined color information.
MRML node to represent procedurally defined color information.
static std::string TempColorNodeID
MRML node to represent discrete color information.
static vtkMRMLAbstractLogic * New()