Slicer  4.10
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 
138  virtual void AddDefaultColorNodes();
139 
143  virtual void RemoveDefaultColorNodes();
144 
146  static const char * GetColorTableNodeID(int type);
147 
149  static const char * GetFreeSurferColorNodeID(int type);
150 
152  static const char * GetdGEMRICColorNodeID(int type);
153 
155  static const char * GetPETColorNodeID(int type);
156 
160  static const char * GetProceduralColorNodeID(const char *name);
161 
166  static const char * GetFileColorNodeID(const char *fileName);
167  static std::string GetFileColorNodeSingletonTag(const char * fileName);
168 
170  virtual const char * GetDefaultFreeSurferLabelMapColorNodeID();
171 
173  virtual const char * GetDefaultVolumeColorNodeID();
174 
176  virtual const char * GetDefaultLabelMapColorNodeID();
177 
179  virtual const char * GetDefaultEditorColorNodeID();
180 
182  virtual const char * GetDefaultModelColorNodeID();
183 
185  virtual const char * GetDefaultChartColorNodeID();
186 
188  virtual const char * GetDefaultPlotColorNodeID();
189 
191  void AddColorFile(const char *fileName, std::vector<std::string> *Files);
192 
204  vtkMRMLColorNode* LoadColorFile(const char *fileName, const char *nodeName = NULL);
205 
207  vtkGetStringMacro(UserColorFilePaths);
208  vtkSetStringMacro(UserColorFilePaths);
209 
213  static vtkMRMLColorTableNode* CopyNode(vtkMRMLColorNode* colorNode, const char* copyName);
214 
220  static vtkMRMLProceduralColorNode* CopyProceduralNode(vtkMRMLColorNode* colorNode, const char* copyName);
221 
222 protected:
224  virtual ~vtkMRMLColorLogic();
225  // disable copy constructor and operator
227  void operator=(const vtkMRMLColorLogic&);
228 
230  virtual void SetMRMLSceneInternal(vtkMRMLScene* newScene) VTK_OVERRIDE;
231 
234  virtual void OnMRMLSceneNewEvent();
235 
236  vtkMRMLColorTableNode* CreateLabelsNode();
237  vtkMRMLColorTableNode* CreateDefaultTableNode(int type);
238  vtkMRMLProceduralColorNode* CreateRandomNode();
239  vtkMRMLProceduralColorNode* CreateRedGreenBlueNode();
240  vtkMRMLFreeSurferProceduralColorNode* CreateFreeSurferNode(int type);
241  vtkMRMLColorTableNode* CreateFreeSurferFileNode(const char* fileName);
242  vtkMRMLPETProceduralColorNode* CreatePETColorNode(int type);
243  vtkMRMLdGEMRICProceduralColorNode* CreatedGEMRICColorNode(int type);
244  vtkMRMLColorTableNode* CreateDefaultFileNode(const std::string& colorname);
245  vtkMRMLColorTableNode* CreateUserFileNode(const std::string& colorname);
246  vtkMRMLColorTableNode* CreateFileNode(const char* fileName);
247  vtkMRMLProceduralColorNode* CreateProceduralFileNode(const char* fileName);
248 
249  void AddLabelsNode();
250  void AddDefaultTableNode(int i);
251  void AddDefaultProceduralNodes();
252  void AddFreeSurferNode(int type);
253  void AddFreeSurferFileNode(vtkMRMLFreeSurferProceduralColorNode* basicFSNode);
254  void AddPETNode(int type);
255  void AddDGEMRICNode(int type);
256  void AddDefaultFileNode(int i);
257  void AddUserFileNode(int i);
258 
259  void AddDefaultTableNodes();
260  void AddFreeSurferNodes();
261  void AddPETNodes();
262  void AddDGEMRICNodes();
263  void AddDefaultFileNodes();
264  void AddUserFileNodes();
265 
266  virtual std::vector<std::string> FindDefaultColorFiles();
267  virtual std::vector<std::string> FindUserColorFiles();
268 
271  static const char * GetColorNodeID(vtkMRMLColorNode* colorNode);
272 
277  std::vector<std::string> ColorFiles;
278 
281  std::vector<std::string> UserColorFiles;
286 
287  static std::string TempColorNodeID;
288 
289  std::string RemoveLeadAndTrailSpaces(std::string);
290 };
291 
292 #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()