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