Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 // 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 vtkMRMLAnnotationLineDisplayNode class.
7 //
8 
9 #ifndef __vtkMRMLAnnotationLinesNode_h
10 #define __vtkMRMLAnnotationLinesNode_h
11 
13 
15 
17 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationLinesNode
19 {
20 public:
23  // void PrintSelf(ostream& os, vtkIndent indent) override;
24  // Description:
25  // Just prints short summary
26  void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) override;
27 
28  //--------------------------------------------------------------------------
29  // MRMLNode methods
30  //--------------------------------------------------------------------------
31 
32  vtkMRMLNode* CreateNodeInstance() override;
33  // Description:
34  // Get node XML tag name (like Volume, Model)
35  const char* GetNodeTagName() override {return "AnnotationLines";}
36 
37  // Description:
38  // Read node attributes from XML file
39  void ReadXMLAttributes( const char** atts) override;
40 
41  // Description:
42  // Write this node's information to a MRML file in XML format.
43  void WriteXML(ostream& of, int indent) override;
44 
48 
49  void UpdateScene(vtkMRMLScene *scene) override;
50 
51  // Description:
52  // alternative method to propagate events generated in Display nodes
53  void ProcessMRMLEvents ( vtkObject * /*caller*/,
54  unsigned long /*event*/,
55  void * /*callData*/ ) override;
56 
57 
58  // Description:
59  // get associated display node or nullptr if not set
60  vtkMRMLAnnotationLineDisplayNode* GetAnnotationLineDisplayNode();
61 
62  // Description:
63  // Create default storage node or nullptr if does not have one
65 
66  // Define line between control points
67  int AddLine(int ctrlPtIdStart, int ctrlPtIdEnd,int selectedFlag, int visibleFlag);
68  int SetLine(int id, int ctrlPtIdStart, int ctrlPtIdEnd, int selectedFlag, int visibleFlag);
69 
70  int SetControlPoint(int id, double newControl[3],int selectedFlag, int visibleFlag);
71 
72  int SetControlPointWorldCoordinates(int id, double newControl[3],int selectedFlag, int visibleFlag)
73  {
74  double localPoint[4]={0,0,0,1};
75  this->TransformPointFromWorld(newControl, localPoint);
76  return this->SetControlPoint(id, localPoint, selectedFlag, visibleFlag);
77  }
78 
79  void DeleteLine(int id);
80  int GetEndPointsId(vtkIdType lineID, vtkIdType ctrlPtID[2]);
81  int GetNumberOfLines();
82 
83  // Description:
84  // add line display node if not already present
85  void CreateAnnotationLineDisplayNode();
86 
87  enum
88  {
91  NUM_LINE_ATTRIBUTE_TYPES
92  };
93 
94  const char *GetAttributeTypesEnumAsString(int val) override;
95 
96  // Description:
97  // Initializes all variables associated with annotations
98  void ResetAnnotations() override;
99 
100  void Initialize(vtkMRMLScene* mrmlScene) override;
101 
102 protected:
104  ~vtkMRMLAnnotationLinesNode() override;
107 
108  // Description:
109  // Create Poly data with substructures necessary for this class
110  void CreatePolyData();
111 
112  // Description:
113  // Initializes control points as well as attributes
114  void ResetLines();
115 
116  // Description:
117  // Initializes all attributes
118  void ResetLinesAttributesAll();
119 
121 };
122 
123 #endif
vtkMRMLCopyContentDefaultMacro(vtkMRMLAnnotationControlPointsNode)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag)
void Initialize(vtkMRMLScene *mrmlScene) override
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Display nodes
static vtkMRMLAnnotationControlPointsNode * New()
void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1) override
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
A superclass for other storage nodes.
vtkMRMLStorageNode * CreateDefaultStorageNode() override
void operator=(const vtkMRMLAnnotationControlPointsNode &)
void UpdateScene(vtkMRMLScene *scene) override
Finds the storage node and read the data
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
const char * GetAttributeTypesEnumAsString(int val) override
virtual void TransformPointFromWorld(const double inWorld[3], double outLocal[3])
int SetControlPoint(int id, double newControl[3], int selectedFlag, int visibleFlag)