Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLAnnotationControlPointsNode.h
Go to the documentation of this file.
1// .NAME vtkMRMLAnnotationControlPointsNode - MRML node to represent a fiber bundle from tractography in DTI data.
2// .SECTION Description
3// Annotation nodes contains control points, internally represented as vtkPolyData.
4// A Annotation node contains many control points and forms the smallest logical unit of tractography
5// that MRML will manage/read/write. Each control point has accompanying data.
6// Visualization parameters for these nodes are controlled by the vtkMRMLAnnotationPointDisplayNode class.
7//
8
9#ifndef __vtkMRMLAnnotationControlPointsNode_h
10#define __vtkMRMLAnnotationControlPointsNode_h
11
13
15
17class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationControlPointsNode
19{
20public:
23
24 // void PrintSelf(ostream& os, vtkIndent indent) override;
25 // Description:
26 // Just prints short summary
27 void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) override;
28
29 //--------------------------------------------------------------------------
30 // MRMLNode methods
31 //--------------------------------------------------------------------------
32
34 // Description:
35 // Get node XML tag name (like Volume, Model)
36 const char* GetNodeTagName() override {return "AnnotationControlPoints";}
37
38 // Description:
39 // Read node attributes from XML file
40 void ReadXMLAttributes( const char** atts) override;
41
42 // Description:
43 // Write this node's information to a MRML file in XML format.
44 void WriteXML(ostream& of, int indent) override;
45
50 void WriteCLI(std::vector<std::string>& commandLine,
51 std::string prefix, int coordinateSystem = 0,
52 int multipleFlag = 1) override;
53
57
58 void UpdateScene(vtkMRMLScene *scene) override;
59
60 // Description:
61 // alternative method to propagate events generated in Display nodes
62 void ProcessMRMLEvents ( vtkObject * /*caller*/,
63 unsigned long /*event*/,
64 void * /*callData*/ ) override;
65
66
67 enum
68 {
69 ControlPointModifiedEvent = 19010,
70 };
71
72 void Modified() override
73 {
74 Superclass::Modified();
75
76 if (!this->GetDisableModifiedEvent())
77 {
79 }
80 }
81
87 {
88 if ( this->GetModifiedEventPending() )
89 {
91 }
92 return Superclass::InvokePendingModifiedEvent();
93 }
94
95 // Description:
96 // get associated display node or nullptr if not set
98
99 // Description:
100 // Create default storage node or nullptr if does not have one
102
103 int AddControlPoint(double newControl[3],int selectedFlag, int visibleFlag);
104
105 int SetControlPoint(int id, double newControl[3],int selectedFlag, int visibleFlag);
106
107 int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag);
108
109 int SetControlPoint(int id, double newControl[3]);
110
111 int SetControlPointWorldCoordinates(int id, double newControl[3]);
112
113 void DeleteControlPoint(int id);
117 double* GetControlPointCoordinates(vtkIdType id);
118
119 void GetControlPointWorldCoordinates(vtkIdType id, double *point);
120
122
123 enum
124 {
127 NUM_CP_ATTRIBUTE_TYPES
128 };
129
130 const char *GetAttributeTypesEnumAsString(int val) override;
131
132
133 // Description:
134 // Initializes all variables associated with annotations
135 void ResetAnnotations() override;
136
137 // Description:
138 // add display node if not already present
140
143 {
144 SchemeMin = 0,
145 UseID = SchemeMin,
148 SchemeMax = UsePrevious,
149 };
150
151
153 virtual void SetNumberingScheme(int numberingScheme);
154 vtkGetMacro(NumberingScheme, int);
155
158 const char* GetNumberingSchemeAsString(int g);
159 void SetNumberingSchemeFromString(const char *schemeString);
160
161 void Initialize(vtkMRMLScene* mrmlScene) override;
162
163protected:
168
169 // Description:
170 // Create Poly data with substructures necessary for this class
172
173 // Description:
174 // Initializes control points as well as attributes
176
177 // Description:
178 // Initializes all attributes
180
183};
184
185#endif
void WriteXML(ostream &of, int indent) override
int AddControlPoint(double newControl[3], int selectedFlag, int visibleFlag)
const char * GetNumberingSchemeAsString()
Return a string representing the numbering scheme, set it from a string.
double * GetControlPointCoordinates(vtkIdType id)
int NumberingScheme
How the next annotation will be numbered in it's Text field.
static vtkMRMLAnnotationControlPointsNode * New()
virtual void SetNumberingScheme(int numberingScheme)
Flag determining how to number the next added fiducial.
void WriteCLI(std::vector< std::string > &commandLine, std::string prefix, int coordinateSystem=0, int multipleFlag=1) override
int SetControlPoint(int id, double newControl[3])
void UpdateScene(vtkMRMLScene *scene) override
int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag)
vtkMRMLAnnotationPointDisplayNode * GetAnnotationPointDisplayNode()
~vtkMRMLAnnotationControlPointsNode() override=default
void operator=(const vtkMRMLAnnotationControlPointsNode &)
int SetControlPointWorldCoordinates(int id, double newControl[3])
const char * GetNumberingSchemeAsString(int g)
vtkMRMLCopyContentDefaultMacro(vtkMRMLAnnotationControlPointsNode)
void ReadXMLAttributes(const char **atts) override
void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1) override
vtkMRMLAnnotationControlPointsNode(const vtkMRMLAnnotationControlPointsNode &)
int SetControlPoint(int id, double newControl[3], int selectedFlag, int visibleFlag)
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
const char * GetAttributeTypesEnumAsString(int val) override
void SetNumberingSchemeFromString(const char *schemeString)
void Initialize(vtkMRMLScene *mrmlScene) override
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void GetControlPointWorldCoordinates(vtkIdType id, double *point)
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
Propagate events generated in mrml.
vtkMRMLStorageNode * CreateDefaultStorageNode() override
NumberingSchemes
flags to determine how the next fiducial added to the list is labelled
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
A superclass for other storage nodes.