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