Slicer 5.8
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// An 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
16class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationControlPointsNode
18{
19public:
22
23 // void PrintSelf(ostream& os, vtkIndent indent) override;
24 // Description:
25 // Just prints short summary
26 void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) override;
27
28 //--------------------------------------------------------------------------
29 // MRMLNode methods
30 //--------------------------------------------------------------------------
31
33 // Description:
34 // Get node XML tag name (like Volume, Model)
35 const char* GetNodeTagName() override {return "AnnotationControlPoints";}
36
37 // Description:
38 // Read node attributes from XML file
39 void ReadXMLAttributes( const char** atts) override;
40
41 // Description:
42 // Write this node's information to a MRML file in XML format.
43 void WriteXML(ostream& of, int indent) override;
44
49 void WriteCLI(std::vector<std::string>& commandLine,
50 std::string prefix, int coordinateSystem = 0,
51 int multipleFlag = 1) override;
52
56
57 void UpdateScene(vtkMRMLScene *scene) override;
58
59 // Description:
60 // alternative method to propagate events generated in Display nodes
61 void ProcessMRMLEvents ( vtkObject * /*caller*/,
62 unsigned long /*event*/,
63 void * /*callData*/ ) override;
64
65
66 enum
67 {
68 ControlPointModifiedEvent = 19010,
69 };
70
71 void Modified() override
72 {
73 Superclass::Modified();
74
75 if (!this->GetDisableModifiedEvent())
76 {
78 }
79 }
80
86 {
87 if ( this->GetModifiedEventPending() )
88 {
90 }
91 return Superclass::InvokePendingModifiedEvent();
92 }
93
94 // Description:
95 // get associated display node or nullptr if not set
97
98 // Description:
99 // Create default storage node or nullptr if does not have one
101
102 int AddControlPoint(double newControl[3],int selectedFlag, int visibleFlag);
103
104 int SetControlPoint(int id, double newControl[3],int selectedFlag, int visibleFlag);
105
106 int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag);
107
108 int SetControlPoint(int id, double newControl[3]);
109
110 int SetControlPointWorldCoordinates(int id, double newControl[3]);
111
112 void DeleteControlPoint(int id);
116 double* GetControlPointCoordinates(vtkIdType id);
117
118 void GetControlPointWorldCoordinates(vtkIdType id, double *point);
119
121
122 enum
123 {
126 NUM_CP_ATTRIBUTE_TYPES
127 };
128
129 const char *GetAttributeTypesEnumAsString(int val) override;
130
131
132 // Description:
133 // Initializes all variables associated with annotations
134 void ResetAnnotations() override;
135
136 // Description:
137 // add display node if not already present
139
142 {
143 SchemeMin = 0,
144 UseID = SchemeMin,
147 SchemeMax = UsePrevious,
148 };
149
150
152 virtual void SetNumberingScheme(int numberingScheme);
153 vtkGetMacro(NumberingScheme, int);
154
157 const char* GetNumberingSchemeAsString(int g);
158 void SetNumberingSchemeFromString(const char *schemeString);
159
160 void Initialize(vtkMRMLScene* mrmlScene) override;
161
162protected:
167
168 // Description:
169 // Create Poly data with substructures necessary for this class
171
172 // Description:
173 // Initializes control points as well as attributes
175
176 // Description:
177 // Initializes all attributes
179
182};
183
184#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.