Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLAnnotationLinesNode.h
Go to the documentation of this file.
1// .NAME vtkMRMLAnnotationLinesNode - 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 vtkMRMLAnnotationLineDisplayNode class.
7//
8
9#ifndef __vtkMRMLAnnotationLinesNode_h
10#define __vtkMRMLAnnotationLinesNode_h
11
13
15
17class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationLinesNode
19{
20public:
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 "AnnotationLines";}
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
48
49 void UpdateScene(vtkMRMLScene *scene) override;
50
51 // Description:
52 // alternative method to propagate events generated in Display nodes
53 void ProcessMRMLEvents ( vtkObject * /*caller*/,
54 unsigned long /*event*/,
55 void * /*callData*/ ) override;
56
57
58 // Description:
59 // get associated display node or nullptr if not set
61
62 // Description:
63 // Create default storage node or nullptr if does not have one
65
66 // Define line between control points
67 int AddLine(int ctrlPtIdStart, int ctrlPtIdEnd,int selectedFlag, int visibleFlag);
68 int SetLine(int id, int ctrlPtIdStart, int ctrlPtIdEnd, int selectedFlag, int visibleFlag);
69
70 int SetControlPoint(int id, double newControl[3],int selectedFlag, int visibleFlag);
71
72 int SetControlPointWorldCoordinates(int id, double newControl[3],int selectedFlag, int visibleFlag)
73 {
74 double localPoint[4]={0,0,0,1};
75 this->TransformPointFromWorld(newControl, localPoint);
76 return this->SetControlPoint(id, localPoint, selectedFlag, visibleFlag);
77 }
78
79 void DeleteLine(int id);
80 int GetEndPointsId(vtkIdType lineID, vtkIdType ctrlPtID[2]);
82
83 // Description:
84 // add line display node if not already present
86
87 enum
88 {
91 NUM_LINE_ATTRIBUTE_TYPES
92 };
93
94 const char *GetAttributeTypesEnumAsString(int val) override;
95
96 // Description:
97 // Initializes all variables associated with annotations
98 void ResetAnnotations() override;
99
100 void Initialize(vtkMRMLScene* mrmlScene) override;
101
102protected:
107
108 // Description:
109 // Create Poly data with substructures necessary for this class
111
112 // Description:
113 // Initializes control points as well as attributes
115
116 // Description:
117 // Initializes all attributes
119
121};
122
123#endif
int SetControlPoint(int id, double newControl[3], int selectedFlag, int visibleFlag)
~vtkMRMLAnnotationLinesNode() override
void ReadXMLAttributes(const char **atts) override
int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag)
vtkMRMLStorageNode * CreateDefaultStorageNode() override
vtkMRMLCopyContentDefaultMacro(vtkMRMLAnnotationLinesNode)
void Initialize(vtkMRMLScene *mrmlScene) override
void ResetAnnotations() override
int SetLine(int id, int ctrlPtIdStart, int ctrlPtIdEnd, int selectedFlag, int visibleFlag)
void WriteXML(ostream &of, int indent) override
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
vtkMRMLAnnotationLineDisplayNode * GetAnnotationLineDisplayNode()
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
Propagate events generated in mrml.
vtkMRMLAnnotationLinesNode(const vtkMRMLAnnotationLinesNode &)
void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1) override
void operator=(const vtkMRMLAnnotationLinesNode &)
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
static vtkMRMLAnnotationLinesNode * New()
int AddLine(int ctrlPtIdStart, int ctrlPtIdEnd, int selectedFlag, int visibleFlag)
int GetEndPointsId(vtkIdType lineID, vtkIdType ctrlPtID[2])
void UpdateScene(vtkMRMLScene *scene) override
const char * GetAttributeTypesEnumAsString(int val) override
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.