Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLFiducialListNode.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  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLFiducialListNode.h,v $
10  Date: $Date: 2006/03/19 17:12:28 $
11  Version: $Revision: 1.6 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLFiducialListNode_h
16 #define __vtkMRMLFiducialListNode_h
17 
18 // MRML includes
20 class vtkMRMLFiducial;
22 
23 // VTK includes
24 class vtkMatrix4x4;
25 class vtkCollection;
26 
27 // STD includes
28 #include <string>
29 
33 typedef struct
34 {
35  int first;
36  int second;
38 
46 class VTK_MRML_EXPORT vtkMRMLFiducialListNode : public vtkMRMLTransformableNode
47 {
48 public:
52  static vtkMRMLFiducialListNode *New();
54  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
55 
59 
60  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
61 
63  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
64 
66  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
67 
68 
70  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
71 
73  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "FiducialList";}
74 
76  virtual void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE;
77 
79  void UpdateReferences() VTK_OVERRIDE;
80 
83  void SetSymbolScale(double scale);
84  vtkGetMacro(SymbolScale,double);
85 
86 
89  void SetVisibility(int visible);
90  vtkGetMacro(Visibility,int);
91 
94  void SetTextScale(double scale);
95  vtkGetMacro(TextScale,double);
96 
99  void SetColor(double r, double g, double b);
100  void SetColor(double c[3]);
101  vtkGetVectorMacro(Color,double,3);
102 
104  void SetSelectedColor(double r, double g, double b);
105  void SetSelectedColor(double c[3]);
106  vtkGetVectorMacro(SelectedColor,double,3);
107 
108 
110  int GetNumberOfFiducials();
111 
114  int SetNthFiducialXYZ(int n, float x, float y, float z);
115  int SetNthFiducialOrientation(int n, float w, float x, float y, float z);
116  int SetNthFiducialLabelText(int n, const char *text);
117  int SetNthFiducialSelected(int n, int flag);
118  int SetNthFiducialSelectedNoModified(int n, int flag);
119  int SetNthFiducialVisibility(int n, int flag);
120  int SetNthFiducialVisibilityNoModified(int n, int flag);
121  int SetNthFiducialID(int n, const char *id);
122 
126  int SetNthFiducialXYZWorld(int n, float x, float y, float z);
127 
130  int SetFiducialXYZ(std::string fiducialID, float x, float y, float z);
134  int GetFiducialIndex(std::string fiducialID);
135 
137  int SetAllFiducialsSelected(int flag);
138 
140  int SetAllFiducialsVisibility(int flag);
141 
144  float *GetNthFiducialXYZ(int n);
145 
150  int GetNthFiducialXYZWorld(int n, double *worldxyz);
152  float *GetNthFiducialOrientation(int n);
154  const char *GetNthFiducialLabelText(int n);
156  int GetNthFiducialSelected(int n);
158  int GetNthFiducialVisibility(int n);
160  const char *GetNthFiducialID(int n);
161 
163  int AddFiducial( );
164 
166  int AddFiducialWithXYZ(float x, float y, float z, int selected);
168  int AddFiducialWithLabelXYZSelectedVisibility(const char *label, float x, float y, float z, int selected, int visibility);
169 
171  void RemoveFiducial(vtkMRMLFiducial *o);
173  void RemoveFiducial(int i);
175  void RemoveAllFiducials();
177  int IsFiducialPresent(vtkMRMLFiducial *o);
178 
180  void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData ) VTK_OVERRIDE;
181 
184  enum
185  {
186  DisplayModifiedEvent = 19000,
187  PolyDataModifiedEvent = 19001,
188  FiducialModifiedEvent = 19002,
189  FiducialIndexModifiedEvent = 19003
190  };
191 
193  void SetOpacity(double opacity);
194  vtkGetMacro(Opacity, double);
195 
197  void SetAmbient(double val);
198  vtkGetMacro(Ambient, double);
199 
201  void SetDiffuse(double val);
202  vtkGetMacro(Diffuse, double);
203 
205  void SetSpecular(double val);
206  vtkGetMacro(Specular, double);
207 
209  void SetPower(double val);
210  vtkGetMacro(Power, double);
211 
213  void SetLocked(int locked);
214  vtkGetMacro(Locked, int);
215 
219  {
220  GlyphMin = 1,
221  Vertex2D = GlyphMin,
235  GlyphMax = Diamond3D
236  };
237 
241 
243  void SetGlyphType(int type);
244  vtkGetMacro(GlyphType, int);
246  int GlyphTypeIs3D(int glyphType);
247  int GlyphTypeIs3D() { return this->GlyphTypeIs3D(this->GlyphType); };
248 
250  const char* GetGlyphTypeAsString();
251  const char* GetGlyphTypeAsString(int g);
252  void SetGlyphTypeFromString(const char *glyphString);
253 
255  virtual bool CanApplyNonLinearTransforms()const VTK_OVERRIDE;
256  virtual void ApplyTransform(vtkAbstractTransform* transform) VTK_OVERRIDE;
257 
259  virtual vtkMRMLStorageNode* CreateDefaultStorageNode() VTK_OVERRIDE;
260 
264  int MoveFiducialUp(int fidIndex);
265  int MoveFiducialDown(int fidIndex);
266 
270  void RenumberFiducials(int startFrom = 0);
271 
274  void RenameFiducials(const char *newName);
275 
278  {
279  SchemeMin = 0,
280  UseID = SchemeMin,
283  SchemeMax = UsePrevious
284  };
285 
287  vtkSetMacro(NumberingScheme, int);
288  vtkGetMacro(NumberingScheme, int);
289 
291  const char* GetNumberingSchemeAsString();
292  const char* GetNumberingSchemeAsString(int g);
293  void SetNumberingSchemeFromString(const char *schemeString);
294 
302  void SetFiducialLabelTextFromID(vtkMRMLFiducial *fid);
303 
304 protected:
308  void operator=(const vtkMRMLFiducialListNode&);
309 
312  vtkMRMLFiducial* GetNthFiducial(int n);
313 
314  double SymbolScale;
315  double TextScale;
317  double Color[3];
318  double SelectedColor[3];
319 
321  vtkCollection *FiducialList;
322 
324  double Opacity;
325  double Ambient;
326  double Diffuse;
327  double Specular;
328  double Power;
329  int Locked;
331 
334 };
335 
336 #endif
MRML node for handling fiducial list storage.
int GetMinimumGlyphType()
Return the min/max glyph types, for iterating over them in tcl.
NumberingSchemes
Flags to determine how the next fiducial added to the list is labelled.
LRU Cache.
MRML node to represent a list of points in 3D.
virtual void UpdateReferences()
The method should remove all pointers and observations to all nodes that are not in the scene anymore...
double Opacity
Numbers relating to the display of the fiducials.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
void operator=(const vtkMRMLTransformableNode &)
virtual vtkMRMLNode * CreateNodeInstance() VTK_OVERRIDE=0
MRMLNode methods.
A superclass for other storage nodes.
MRML object to represent a 3D point.
virtual bool CanApplyNonLinearTransforms() const
vtkCollection * FiducialList
The collection of fiducial points that make up this list.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
virtual void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE
Finds the storage node and read the data
int NumberingScheme
How the next added fiducial will be numbered in it&#39;s LabelText field.
MRML node for representing a node with a transform.