Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationPointDisplayNode.h
Go to the documentation of this file.
1 // .NAME vtkMRMLAnnotationPointDisplayNode - MRML node to represent display properties for tractography.
2 // .SECTION Description
3 // vtkMRMLAnnotationPointDisplayNode nodes store display properties of trajectories
4 // from tractography in diffusion MRI data, including color type (by bundle, by fiber,
5 // or by scalar invariants), display on/off for tensor glyphs and display of
6 // trajectory as a line or tube.
7 //
8 
9 #ifndef __vtkMRMLAnnotationPointDisplayNode_h
10 #define __vtkMRMLAnnotationPointDisplayNode_h
11 
12 #include "vtkMRML.h"
14 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
15 
17 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationPointDisplayNode : public vtkMRMLAnnotationDisplayNode
18 {
19  public:
22  void PrintSelf ( ostream& os, vtkIndent indent ) override;
23 
24  //--------------------------------------------------------------------------
25  // MRMLNode methods
26  //--------------------------------------------------------------------------
27 
28  vtkMRMLNode* CreateNodeInstance () override;
29 
30  // Description:
31  // Read node attributes from XML (MRML) file
32  void ReadXMLAttributes ( const char** atts ) override;
33 
34  // Description:
35  // Write this node's information to a MRML file in XML format.
36  void WriteXML ( ostream& of, int indent ) override;
37 
38 
39  // Description:
40  // Copy the node's attributes to this object
41  void Copy ( vtkMRMLNode *node ) override;
42 
43  // Description:
44  // Get node XML tag name (like Volume, Annotation)
45  const char* GetNodeTagName() override {return "AnnotationPointDisplay";}
46 
47  // Description:
48  // Finds the storage node and read the data
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 
60  {
61  GlyphMin = 1,
62  Vertex2D = GlyphMin,
76  GlyphMax = Sphere3D,
77  };
81 
83  void SetGlyphType(int type);
84  vtkGetMacro(GlyphType, int);
86  int GlyphTypeIs3D(int glyphType);
87  int GlyphTypeIs3D() { return this->GlyphTypeIs3D(this->GlyphType); };
88 
90  const char* GetGlyphTypeAsString();
91  const char* GetGlyphTypeAsString(int g);
92  void SetGlyphTypeFromString(const char *glyphString);
93 
96  void SetGlyphScale(double scale);
97  vtkGetMacro(GlyphScale,double);
98 
100  void CreateBackup() override;
102  void RestoreBackup() override;
103 
106  inline void SliceProjectionUseFiducialColorOn();
107 
110  inline void SliceProjectionUseFiducialColorOff();
111 
115  inline void SliceProjectionOutlinedBehindSlicePlaneOn();
116 
120  inline void SliceProjectionOutlinedBehindSlicePlaneOff();
121 
128  {
129  ProjectionUseFiducialColor = 0x02,
130  ProjectionOutlinedBehindSlicePlane = 0x04
131  };
132 
133  protected:
135  ~vtkMRMLAnnotationPointDisplayNode() override = default;
138 
139  double GlyphScale;
141  static const char* GlyphTypesNames[GlyphMax+2];
142 };
143 
144 //----------------------------------------------------------------------------
147 {
148  this->SetSliceProjection( this->GetSliceProjection() |
150 }
151 
152 //----------------------------------------------------------------------------
155 {
156  this->SetSliceProjection( this->GetSliceProjection() &
158 }
159 
160 //----------------------------------------------------------------------------
163 {
164  this->SetSliceProjection( this->GetSliceProjection() |
166 }
167 
168 //----------------------------------------------------------------------------
171 {
172  this->SetSliceProjection( this->GetSliceProjection() &
174 }
175 
176 #endif
void UpdateScene(vtkMRMLScene *scene) override
Finds the storage node and read the data.
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void CreateBackup()
Creates a backup of the current MRML state of this node and keeps a reference.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
int GetMinimumGlyphType()
Return the min/max glyph types, for iterating over them in tcl.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
void Copy(vtkMRMLNode *node) override
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
void operator=(const vtkMRMLAnnotationDisplayNode &)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
static vtkMRMLAnnotationDisplayNode * New()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override