Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationLineDisplayNode.h
Go to the documentation of this file.
1 // .NAME vtkMRMLAnnotationLineDisplayNode - MRML node to represent display properties for tractography.
2 // .SECTION Description
3 // vtkMRMLAnnotationLineDisplayNode 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 __vtkMRMLAnnotationLineDisplayNode_h
10 #define __vtkMRMLAnnotationLineDisplayNode_h
11 
12 #include "vtkMRML.h"
14 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
15 
17 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationLineDisplayNode : 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 "AnnotationLineDisplay";}
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 
59  void SetLineThickness(double thickness);
60  vtkGetMacro(LineThickness,double);
61 
63  vtkSetClampMacro(LabelPosition, double, 0.0, 1.0);
64  vtkGetMacro(LabelPosition, double);
65 
67  vtkBooleanMacro(LabelVisibility, int);
68  vtkSetMacro(LabelVisibility, int);
69  vtkGetMacro(LabelVisibility, int);
70 
72  vtkSetMacro(TickSpacing, double);
73  vtkGetMacro(TickSpacing, double);
74 
76  vtkSetMacro(MaxTicks, int);
77  vtkGetMacro(MaxTicks, int);
78 
80  inline void SliceProjectionDashedOn();
81 
83  inline void SliceProjectionDashedOff();
84 
86  inline void SliceProjectionColoredWhenParallelOn();
87 
89  inline void SliceProjectionColoredWhenParallelOff();
90 
92  inline void SliceProjectionThickerOnTopOn();
93 
95  inline void SliceProjectionThickerOnTopOff();
96 
99  inline void SliceProjectionUseRulerColorOn();
100 
103  inline void SliceProjectionUseRulerColorOff();
104 
114  {
115  ProjectionDashed = 0x02,
116  ProjectionColoredWhenParallel = 0x04,
117  ProjectionThickerOnTop = 0x08,
118  ProjectionUseRulerColor = 0x10
119  };
120 
123  vtkSetMacro(UnderLineThickness, double);
124  vtkGetMacro(UnderLineThickness, double);
125 
128  vtkSetMacro(OverLineThickness, double);
129  vtkGetMacro(OverLineThickness, double);
130 
132  void CreateBackup() override;
134  void RestoreBackup() override;
135 
136 protected:
138  ~vtkMRMLAnnotationLineDisplayNode() override = default;
141 
145  double TickSpacing;
146  int MaxTicks;
147 
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 //----------------------------------------------------------------------------
179 {
180  this->SetSliceProjection( this->GetSliceProjection() &
182 }
183 
184 //----------------------------------------------------------------------------
187 {
188  this->SetSliceProjection( this->GetSliceProjection() |
190 }
191 
192 //----------------------------------------------------------------------------
195 {
196  this->SetSliceProjection( this->GetSliceProjection() &
198 }
199 
200 //----------------------------------------------------------------------------
203 {
204  this->SetSliceProjection( this->GetSliceProjection() |
206 }
207 
208 //----------------------------------------------------------------------------
211 {
212  this->SetSliceProjection( this->GetSliceProjection() &
214 }
215 
216 #endif
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
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 SliceProjectionColoredWhenParallelOff()
Set line color unchanged when parallel to slice plane.
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 SliceProjectionDashedOff()
Set SliceProjection to Plain.
void SliceProjectionThickerOnTopOff()
Set line thickness uniform.
void SliceProjectionDashedOn()
Set SliceProjection to Dashed.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
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 SliceProjectionColoredWhenParallelOn()
Set line colored when parallel to slice plane.
void operator=(const vtkMRMLAnnotationDisplayNode &)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
void SliceProjectionThickerOnTopOn()
Set line thicker when on top of the plane, thiner when under.
static vtkMRMLAnnotationDisplayNode * New()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override