Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationFiducialNode.h
Go to the documentation of this file.
1 #ifndef __vtkMRMLAnnotationFiducialNode_h
2 #define __vtkMRMLAnnotationFiducialNode_h
3 
4 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
6 
7 #include <vtkStdString.h>
8 class vtkStringArray;
10 
20 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationFiducialNode : public vtkMRMLAnnotationControlPointsNode
21 {
22 public:
25 
26  //--------------------------------------------------------------------------
27  // MRMLNode methods
28  //--------------------------------------------------------------------------
29 
30  vtkMRMLNode* CreateNodeInstance() override;
32  const char* GetNodeTagName() override {return "AnnotationFiducials";}
33 
34  const char* GetIcon() override {return ":/Icons/AnnotationPoint.png";}
35 
36  int SetFiducial(double newControl[3],int selectedFlag, int visibleFlag);
37 
39  void SetFiducialLabel(const char* newLabel)
40  {
41  this->SetText(0,newLabel,1,1);
42  }
43 
44  vtkStdString GetFiducialLabel()
45  {
46  return this->GetText(0);
47  }
48 
49  void SetFiducialValue(const char* newValue)
50  {
51  this->SetText(1,newValue,1,1);
52  }
53 
56  {
57  return 0;
58  }
59 
60  int SetFiducialCoordinates(double newCoord[3], int selFlag = 1, int visFlag = 1)
61  {
62  return this->SetControlPoint(0,newCoord,selFlag,visFlag);
63  }
64 
65  int SetFiducialWorldCoordinates(double newCoord[3], int selFlag = 1, int visFlag = 1)
66  {
67  return this->SetControlPointWorldCoordinates(0,newCoord,selFlag,visFlag);
68  }
69 
70  int SetFiducialCoordinates(double x, double y, double z)
71  {
72  double newCoord[3];
73  newCoord[0] = x;
74  newCoord[1] = y;
75  newCoord[2] = z;
76  return this->SetFiducialCoordinates(newCoord);
77  }
78 
80  {
81  return this->GetControlPointCoordinates(0);
82  }
83 
84  void GetFiducialWorldCoordinates(double *point)
85  {
86  this->GetControlPointWorldCoordinates(0, point);
87  }
88 
90  bool GetFiducialCoordinates(double coord[3]);
91 
92  enum
93  {
94  FiducialNodeAddedEvent = 0,
96  };
97 
98 protected:
102  ~vtkMRMLAnnotationFiducialNode() override;
105 
106  void SetTextFromID();
107 
108 };
109 
110 #endif
static vtkMRMLAnnotationControlPointsNode * New()
int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag)
int GetFiducialValue()
return atoi(this->GetText(1).c_str());
void SetFiducialValue(const char *newValue)
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
int SetFiducialCoordinates(double x, double y, double z)
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
MRML node to represent a fiducial in the Annotations module - deprecated.
vtkStdString GetText(int id)
A superclass for other storage nodes.
void SetFiducialLabel(const char *newLabel)
Selected and visible are currently always set to 1 and are controlled by selected and visible flag...
double * GetControlPointCoordinates(vtkIdType id)
void SetText(int id, const char *newText, int selectedFlag, int visibleFlag)
int SetFiducialCoordinates(double newCoord[3], int selFlag=1, int visFlag=1)
void operator=(const vtkMRMLAnnotationControlPointsNode &)
void GetControlPointWorldCoordinates(vtkIdType id, double *point)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
int SetFiducialWorldCoordinates(double newCoord[3], int selFlag=1, int visFlag=1)
int SetControlPoint(int id, double newControl[3], int selectedFlag, int visibleFlag)