Slicer 5.6
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// 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 vtkMRMLAnnotationLineDisplayNode class.
7//
8
9#ifndef __vtkMRMLAnnotationLinesNode_h
10#define __vtkMRMLAnnotationLinesNode_h
11
13
15
16class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationLinesNode
18{
19public:
22 // void PrintSelf(ostream& os, vtkIndent indent) override;
23 // Description:
24 // Just prints short summary
25 void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) override;
26
27 //--------------------------------------------------------------------------
28 // MRMLNode methods
29 //--------------------------------------------------------------------------
30
32 // Description:
33 // Get node XML tag name (like Volume, Model)
34 const char* GetNodeTagName() override {return "AnnotationLines";}
35
36 // Description:
37 // Read node attributes from XML file
38 void ReadXMLAttributes( const char** atts) override;
39
40 // Description:
41 // Write this node's information to a MRML file in XML format.
42 void WriteXML(ostream& of, int indent) override;
43
47
48 void UpdateScene(vtkMRMLScene *scene) override;
49
50 // Description:
51 // alternative method to propagate events generated in Display nodes
52 void ProcessMRMLEvents ( vtkObject * /*caller*/,
53 unsigned long /*event*/,
54 void * /*callData*/ ) override;
55
56
57 // Description:
58 // get associated display node or nullptr if not set
60
61 // Description:
62 // Create default storage node or nullptr if does not have one
64
65 // Define line between control points
66 int AddLine(int ctrlPtIdStart, int ctrlPtIdEnd,int selectedFlag, int visibleFlag);
67 int SetLine(int id, int ctrlPtIdStart, int ctrlPtIdEnd, int selectedFlag, int visibleFlag);
68
69 int SetControlPoint(int id, double newControl[3],int selectedFlag, int visibleFlag);
70
71 int SetControlPointWorldCoordinates(int id, double newControl[3],int selectedFlag, int visibleFlag)
72 {
73 double localPoint[4]={0,0,0,1};
74 this->TransformPointFromWorld(newControl, localPoint);
75 return this->SetControlPoint(id, localPoint, selectedFlag, visibleFlag);
76 }
77
78 void DeleteLine(int id);
79 int GetEndPointsId(vtkIdType lineID, vtkIdType ctrlPtID[2]);
81
82 // Description:
83 // add line display node if not already present
85
86 enum
87 {
90 NUM_LINE_ATTRIBUTE_TYPES
91 };
92
93 const char *GetAttributeTypesEnumAsString(int val) override;
94
95 // Description:
96 // Initializes all variables associated with annotations
97 void ResetAnnotations() override;
98
99 void Initialize(vtkMRMLScene* mrmlScene) override;
100
101protected:
106
107 // Description:
108 // Create Poly data with substructures necessary for this class
110
111 // Description:
112 // Initializes control points as well as attributes
114
115 // Description:
116 // Initializes all attributes
118
120};
121
122#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.