Slicer 5.9
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// 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 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
27// STD includes
28#include <string>
29
30class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationNode : public vtkMRMLModelNode
31{
32public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36 // Description:
37 // Just prints short summary
38 virtual void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1);
39
40 virtual const char* GetIcon() { return ""; }
41
42 //--------------------------------------------------------------------------
43 // MRMLNode methods
44 //--------------------------------------------------------------------------
45
47 // Description:
48 // Get node XML tag name (like Volume, Model)
49 const char* GetNodeTagName() override { return "Annotation"; }
50
51 // Description:
52 // Read node attributes from XML file
53 void ReadXMLAttributes(const char** atts) override;
54
55 // Description:
56 // Write this node's information to a MRML file in XML format.
57 void WriteXML(ostream& of, int indent) override;
58
62
63 void UpdateScene(vtkMRMLScene* scene) override;
64
65 // Description:
66 // alternative method to propagate events generated in Display nodes
67 void ProcessMRMLEvents(vtkObject* /*caller*/, unsigned long /*event*/, void* /*callData*/) override;
68
69 // vtkMRMLModelNode overrides it and it handles models only, while in annotations
70 // we have all kinds of nodes (e.g., screenshot), so we need to revert to the generic
71 // storable node implementation.
72 std::string GetDefaultStorageNodeClassName(const char* filename /* =nullptr */) override;
73
74 // Description:
75 // Create default storage node or nullptr if does not have one
77
80 bool CanApplyNonLinearTransforms() const override { return false; }
81
82 int AddText(const char* newText, int selectedFlag, int visibleFlag);
83 void SetText(int id, const char* newText, int selectedFlag, int visibleFlag);
84 std::string GetText(int id);
85 int DeleteText(int id);
86
88
89 enum
90 {
95 };
96 virtual const char* GetAttributeTypesEnumAsString(int val);
97 vtkDataArray* GetAnnotationAttributes(int att);
98 int GetAnnotationAttribute(vtkIdType id, int att);
99 void SetAnnotationAttribute(vtkIdType id, int att, double value);
100 int DeleteAttribute(vtkIdType idAttEntry, vtkIdType idAttType);
101
102 // Description:
103 // Initializes all variables associated with annotations
104 virtual void ResetAnnotations();
105
106 // Description:
107 // add display node if not already present
109
111
113 void SetTextScale(double textScale);
115 double GetTextScale();
116
117 // Description:
118 // Reference of this annotation - can be an image, model, scene , ...
119 vtkGetStringMacro(ReferenceNodeID);
120 vtkSetStringMacro(ReferenceNodeID);
121
125 vtkGetMacro(Locked, int);
126 void SetLocked(int init);
127
128 virtual void Initialize(vtkMRMLScene* mrmlScene);
129
130protected:
135
136 // Description:
137 // Initializes Text as well as attributes
138 // void ResetAnnotations();
139
140 // Description:
141 // Only initializes attributes with ID
142 void ResetAttributes(int id);
143 // Description:
144 // Initializes all attributes
146 void SetAttributeSize(vtkIdType id, vtkIdType n);
147
149 vtkPoints* GetPoints();
150 vtkCellArray* GetLines();
151
152 vtkStringArray* TextList;
154
156
158
159 vtkSmartPointer<vtkMRMLSliceNode> m_RedSliceNode;
160 vtkSmartPointer<vtkMRMLSliceNode> m_YellowSliceNode;
161 vtkSmartPointer<vtkMRMLSliceNode> m_GreenSliceNode;
162 vtkSmartPointer<vtkMRMLCameraNode> m_CameraNode;
163};
164
165#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.
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
std::string GetText(int id)
virtual void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1)
MRML node to represent camera node.
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.