Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLAnnotationNode.h
Go to the documentation of this file.
1// .NAME vtkMRMLAnnotationNode - 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 vtkMRMLAnnotationTextDisplayNode class.
7//
8
9#ifndef __vtkMRMLAnnotationNode_h
10#define __vtkMRMLAnnotationNode_h
11
12// MRML includes
13#include "vtkMRMLModelNode.h"
16
17// Annotations includes
18#include "vtkSlicerAnnotationsModuleMRMLExport.h"
20
21// VTK includes
22#include <vtkSmartPointer.h>
23class vtkCellArray;
24class vtkPoints;
25class vtkStringArray;
26
28class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationNode : public vtkMRMLModelNode
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34 // Description:
35 // Just prints short summary
36 virtual void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1);
37
38 virtual const char* GetIcon() {return "";}
39
40 //--------------------------------------------------------------------------
41 // MRMLNode methods
42 //--------------------------------------------------------------------------
43
45 // Description:
46 // Get node XML tag name (like Volume, Model)
47 const char* GetNodeTagName() override {return "Annotation";}
48
49 // Description:
50 // Read node attributes from XML file
51 void ReadXMLAttributes( const char** atts) override;
52
53 // Description:
54 // Write this node's information to a MRML file in XML format.
55 void WriteXML(ostream& of, int indent) override;
56
57
61
62 void UpdateScene(vtkMRMLScene *scene) override;
63
64 // Description:
65 // alternative method to propagate events generated in Display nodes
66 void ProcessMRMLEvents ( vtkObject * /*caller*/,
67 unsigned long /*event*/,
68 void * /*callData*/ ) override;
69
70 // vtkMRMLModelNode overrides it and it handles models only, while in annotations
71 // we have all kinds of nodes (e.g., screenshot), so we need to revert to the generic
72 // storable node implementation.
73 std::string GetDefaultStorageNodeClassName(const char* filename /* =nullptr */) override;
74
75 // Description:
76 // Create default storage node or nullptr if does not have one
78
81 bool CanApplyNonLinearTransforms()const override {return false;}
82
83 int AddText(const char *newText,int selectedFlag, int visibleFlag);
84 void SetText(int id, const char *newText,int selectedFlag, int visibleFlag);
85 vtkStdString GetText(int id);
86 int DeleteText(int id);
87
89
90 enum
91 {
92 TEXT_SELECTED = 0,
96 };
97 virtual const char *GetAttributeTypesEnumAsString(int val);
98 vtkDataArray* GetAnnotationAttributes(int att);
99 int GetAnnotationAttribute(vtkIdType id, int att);
100 void SetAnnotationAttribute(vtkIdType id, int att, double value);
101 int DeleteAttribute(vtkIdType idAttEntry, vtkIdType idAttType);
102
103 // Description:
104 // Initializes all variables associated with annotations
105 virtual void ResetAnnotations();
106
107 // Description:
108 // add display node if not already present
110
112
114 void SetTextScale(double textScale);
116 double GetTextScale();
117
118
119 // Description:
120 // Reference of this annotation - can be an image, model, scene , ...
121 vtkGetStringMacro (ReferenceNodeID);
122 vtkSetStringMacro (ReferenceNodeID);
123
127 vtkGetMacro(Locked, int);
128 void SetLocked(int init);
129
130 virtual void Initialize(vtkMRMLScene* mrmlScene);
131
132protected:
137
138 // Description:
139 // Initializes Text as well as attributes
140 // void ResetAnnotations();
141
142 // Description:
143 // Only initializes attributes with ID
144 void ResetAttributes(int id);
145 // Description:
146 // Initializes all attributes
148 void SetAttributeSize(vtkIdType id, vtkIdType n);
149
151 vtkPoints* GetPoints();
152 vtkCellArray* GetLines();
153
154 vtkStringArray *TextList;
156
158
160
161 vtkSmartPointer<vtkMRMLSliceNode> m_RedSliceNode;
162 vtkSmartPointer<vtkMRMLSliceNode> m_YellowSliceNode;
163 vtkSmartPointer<vtkMRMLSliceNode> m_GreenSliceNode;
164 vtkSmartPointer<vtkMRMLCameraNode> m_CameraNode;
165
166};
167
168#endif
void SetAttributeSize(vtkIdType id, vtkIdType n)
vtkSmartPointer< vtkMRMLCameraNode > m_CameraNode
void SetAnnotationAttribute(vtkIdType id, int att, double value)
virtual const char * GetIcon()
virtual const char * GetAttributeTypesEnumAsString(int val)
bool CanApplyNonLinearTransforms() const override
int GetAnnotationAttribute(vtkIdType id, int att)
std::string GetDefaultStorageNodeClassName(const char *filename) override
vtkPoints * GetPoints()
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
int AddText(const char *newText, int selectedFlag, int visibleFlag)
virtual void ResetAnnotations()
vtkSmartPointer< vtkMRMLSliceNode > m_YellowSliceNode
virtual void Initialize(vtkMRMLScene *mrmlScene)
void SetText(int id, const char *newText, int selectedFlag, int visibleFlag)
vtkCellArray * GetLines()
vtkMRMLAnnotationNode * m_Backup
void SetLocked(int init)
int DeleteAttribute(vtkIdType idAttEntry, vtkIdType idAttType)
vtkDataArray * GetAnnotationAttributes(int att)
vtkMRMLCopyContentMacro(vtkMRMLAnnotationNode)
static vtkMRMLAnnotationNode * New()
void CreateAnnotationTextDisplayNode()
void UpdateScene(vtkMRMLScene *scene) override
vtkMRMLAnnotationTextDisplayNode * GetAnnotationTextDisplayNode()
void SetTextScale(double textScale)
Set the text scale of the associated text.
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
Propagate events generated in mrml.
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
vtkStdString GetText(int id)
void ReadXMLAttributes(const char **atts) override
vtkSmartPointer< vtkMRMLSliceNode > m_GreenSliceNode
double GetTextScale()
Get the text scale of the associated text.
void WriteXML(ostream &of, int indent) override
~vtkMRMLAnnotationNode() override
vtkSmartPointer< vtkMRMLSliceNode > m_RedSliceNode
void ResetAttributes(int id)
int DeleteText(int id)
vtkMRMLAnnotationNode(const vtkMRMLAnnotationNode &)
void PrintSelf(ostream &os, vtkIndent indent) override
void operator=(const vtkMRMLAnnotationNode &)
vtkMRMLStorageNode * CreateDefaultStorageNode() override
virtual void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1)
MRML node to represent camera node.
MRML node to represent a 3D surface model.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing a slice through RAS space.
A superclass for other storage nodes.