Slicer  4.13
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 
34 {
35  int first;
36  int second;
37 };
39 
47 class VTK_MRML_EXPORT vtkMRMLFiducialListNode : public vtkMRMLTransformableNode
48 {
49 public:
53  static vtkMRMLFiducialListNode *New();
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
60 
61  vtkMRMLNode* CreateNodeInstance() override;
62 
64  void ReadXMLAttributes( const char** atts) override;
65 
67  void WriteXML(ostream& of, int indent) override;
68 
69 
71  void Copy(vtkMRMLNode *node) override;
72 
74  const char* GetNodeTagName() override {return "FiducialList";}
75 
77  void UpdateScene(vtkMRMLScene *scene) override;
78 
80  void UpdateReferences() override;
81 
84  void SetSymbolScale(double scale);
85  vtkGetMacro(SymbolScale,double);
86 
87 
90  void SetVisibility(int visible);
91  vtkGetMacro(Visibility,int);
92 
95  void SetTextScale(double scale);
96  vtkGetMacro(TextScale,double);
97 
100  void SetColor(double r, double g, double b);
101  void SetColor(double c[3]);
102  vtkGetVectorMacro(Color,double,3);
103 
105  void SetSelectedColor(double r, double g, double b);
106  void SetSelectedColor(double c[3]);
107  vtkGetVectorMacro(SelectedColor,double,3);
108 
109 
111  int GetNumberOfFiducials();
112 
115  int SetNthFiducialXYZ(int n, float x, float y, float z);
116  int SetNthFiducialOrientation(int n, float w, float x, float y, float z);
117  int SetNthFiducialLabelText(int n, const char *text);
118  int SetNthFiducialSelected(int n, int flag);
119  int SetNthFiducialSelectedNoModified(int n, int flag);
120  int SetNthFiducialVisibility(int n, int flag);
121  int SetNthFiducialVisibilityNoModified(int n, int flag);
122  int SetNthFiducialID(int n, const char *id);
123 
127  int SetNthFiducialXYZWorld(int n, float x, float y, float z);
128 
131  int SetFiducialXYZ(std::string fiducialID, float x, float y, float z);
135  int GetFiducialIndex(std::string fiducialID);
136 
138  int SetAllFiducialsSelected(int flag);
139 
141  int SetAllFiducialsVisibility(int flag);
142 
145  float *GetNthFiducialXYZ(int n);
146 
151  int GetNthFiducialXYZWorld(int n, double *worldxyz);
153  float *GetNthFiducialOrientation(int n);
155  const char *GetNthFiducialLabelText(int n);
157  int GetNthFiducialSelected(int n);
159  int GetNthFiducialVisibility(int n);
161  const char *GetNthFiducialID(int n);
162 
164  int AddFiducial( );
165 
167  int AddFiducialWithXYZ(float x, float y, float z, int selected);
169  int AddFiducialWithLabelXYZSelectedVisibility(const char *label, float x, float y, float z, int selected, int visibility);
170 
172  void RemoveFiducial(vtkMRMLFiducial *o);
174  void RemoveFiducial(int i);
176  void RemoveAllFiducials();
178  int IsFiducialPresent(vtkMRMLFiducial *o);
179 
181  void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData ) override;
182 
185  enum
186  {
187  DisplayModifiedEvent = 19000,
188  PolyDataModifiedEvent = 19001,
189  FiducialModifiedEvent = 19002,
190  FiducialIndexModifiedEvent = 19003
191  };
192 
194  void SetOpacity(double opacity);
195  vtkGetMacro(Opacity, double);
196 
198  void SetAmbient(double val);
199  vtkGetMacro(Ambient, double);
200 
202  void SetDiffuse(double val);
203  vtkGetMacro(Diffuse, double);
204 
206  void SetSpecular(double val);
207  vtkGetMacro(Specular, double);
208 
210  void SetPower(double val);
211  vtkGetMacro(Power, double);
212 
214  void SetLocked(int locked);
215  vtkGetMacro(Locked, int);
216 
220  {
221  GlyphMin = 1,
222  Vertex2D = GlyphMin,
236  GlyphMax = Diamond3D
237  };
238 
242 
244  void SetGlyphType(int type);
245  vtkGetMacro(GlyphType, int);
247  int GlyphTypeIs3D(int glyphType);
248  int GlyphTypeIs3D() { return this->GlyphTypeIs3D(this->GlyphType); };
249 
251  const char* GetGlyphTypeAsString();
252  const char* GetGlyphTypeAsString(int g);
253  void SetGlyphTypeFromString(const char *glyphString);
254 
256  bool CanApplyNonLinearTransforms()const override;
257  void ApplyTransform(vtkAbstractTransform* transform) override;
258 
261 
265  int MoveFiducialUp(int fidIndex);
266  int MoveFiducialDown(int fidIndex);
267 
271  void RenumberFiducials(int startFrom = 0);
272 
275  void RenameFiducials(const char *newName);
276 
279  {
280  SchemeMin = 0,
281  UseID = SchemeMin,
284  SchemeMax = UsePrevious
285  };
286 
288  vtkSetMacro(NumberingScheme, int);
289  vtkGetMacro(NumberingScheme, int);
290 
292  const char* GetNumberingSchemeAsString();
293  const char* GetNumberingSchemeAsString(int g);
294  void SetNumberingSchemeFromString(const char *schemeString);
295 
303  void SetFiducialLabelTextFromID(vtkMRMLFiducial *fid);
304 
305 protected:
307  ~vtkMRMLFiducialListNode() override;
309  void operator=(const vtkMRMLFiducialListNode&);
310 
313  vtkMRMLFiducial* GetNthFiducial(int n);
314 
315  double SymbolScale;
316  double TextScale;
318  double Color[3];
319  double SelectedColor[3];
320 
322  vtkCollection *FiducialList;
323 
325  double Opacity;
326  double Ambient;
327  double Diffuse;
328  double Specular;
329  double Power;
330  int Locked;
332 
335 };
336 
337 #endif
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
MRML node for handling fiducial list storage.
int GetMinimumGlyphType()
Return the min/max glyph types, for iterating over them in tcl.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
NumberingSchemes
Flags to determine how the next fiducial added to the list is labelled.
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Transform nodes
virtual vtkMRMLStorageNode * CreateDefaultStorageNode()
virtual void ApplyTransform(vtkAbstractTransform *transform)
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.
virtual void Copy(vtkMRMLNode *node)
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:61
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
void operator=(const vtkMRMLTransformableNode &)
A superclass for other storage nodes.
MRML object to represent a 3D point.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual bool CanApplyNonLinearTransforms() const
vtkCollection * FiducialList
The collection of fiducial points that make up this list.
void WriteXML(ostream &of, int indent) override
Write this node&#39;s information to a MRML file in XML format.
void UpdateScene(vtkMRMLScene *scene) override
Finds the storage node and read the data
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
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.