Slicer 5.6
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
27class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationNode : public vtkMRMLModelNode
28{
29public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33 // Description:
34 // Just prints short summary
35 virtual void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1);
36
37 virtual const char* GetIcon() {return "";}
38
39 //--------------------------------------------------------------------------
40 // MRMLNode methods
41 //--------------------------------------------------------------------------
42
44 // Description:
45 // Get node XML tag name (like Volume, Model)
46 const char* GetNodeTagName() override {return "Annotation";}
47
48 // Description:
49 // Read node attributes from XML file
50 void ReadXMLAttributes( const char** atts) override;
51
52 // Description:
53 // Write this node's information to a MRML file in XML format.
54 void WriteXML(ostream& of, int indent) override;
55
56
60
61 void UpdateScene(vtkMRMLScene *scene) override;
62
63 // Description:
64 // alternative method to propagate events generated in Display nodes
65 void ProcessMRMLEvents ( vtkObject * /*caller*/,
66 unsigned long /*event*/,
67 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 vtkStdString GetText(int id);
85 int DeleteText(int id);
86
88
89 enum
90 {
91 TEXT_SELECTED = 0,
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
118 // Description:
119 // Reference of this annotation - can be an image, model, scene , ...
120 vtkGetStringMacro (ReferenceNodeID);
121 vtkSetStringMacro (ReferenceNodeID);
122
126 vtkGetMacro(Locked, int);
127 void SetLocked(int init);
128
129 virtual void Initialize(vtkMRMLScene* mrmlScene);
130
131protected:
136
137 // Description:
138 // Initializes Text as well as attributes
139 // void ResetAnnotations();
140
141 // Description:
142 // Only initializes attributes with ID
143 void ResetAttributes(int id);
144 // Description:
145 // Initializes all attributes
147 void SetAttributeSize(vtkIdType id, vtkIdType n);
148
150 vtkPoints* GetPoints();
151 vtkCellArray* GetLines();
152
153 vtkStringArray *TextList;
155
157
159
160 vtkSmartPointer<vtkMRMLSliceNode> m_RedSliceNode;
161 vtkSmartPointer<vtkMRMLSliceNode> m_YellowSliceNode;
162 vtkSmartPointer<vtkMRMLSliceNode> m_GreenSliceNode;
163 vtkSmartPointer<vtkMRMLCameraNode> m_CameraNode;
164
165};
166
167#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.