Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLDiffusionTensorDisplayPropertiesNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: ,v $
10  Date: $Date: 2006/03/19 17:12:29 $
11  Version: $Revision: 1.3 $
12 
13  =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLDiffusionTensorDisplayPropertiesNode_h
16 #define __vtkMRMLDiffusionTensorDisplayPropertiesNode_h
17 
18 #include "vtkMRMLColorTableNode.h"
19 
20 // VTK includes
21 class vtkPolyData;
22 class vtkAlgorithmOutput;
23 
36 {
37  public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  //--------------------------------------------------------------------------
44  //--------------------------------------------------------------------------
45 
46  vtkMRMLNode* CreateNodeInstance() override;
47 
50  void ReadXMLAttributes( const char** atts) override;
51 
54  void WriteXML(ostream& of, int indent) override;
55 
58  void Copy(vtkMRMLNode *node) override;
59 
62  const char* GetNodeTagName() override {return "DiffusionTensorDisplayProperties";}
63 
64  //--------------------------------------------------------------------------
66  //--------------------------------------------------------------------------
67 
68  enum
69  {
70  Trace = 0,
71  Determinant = 1,
72  RelativeAnisotropy = 2,
73  FractionalAnisotropy = 3,
74  MaxEigenvalue = 4,
75  MidEigenvalue = 5,
76  MinEigenvalue = 6,
77  LinearMeasure = 7,
78  PlanarMeasure = 8,
79  SphericalMeasure = 9,
80  ColorOrientation = 10,
81  D11 = 11,
82  D22 = 12,
83  D33 = 13,
84  Mode = 14,
85  ColorMode = 15,
86  MaxEigenvalueProjX = 16,
87  MaxEigenvalueProjY = 17,
88  MaxEigenvalueProjZ = 18,
89  MaxEigenvec_ProjX = 19,
90  MaxEigenvec_ProjY = 20,
91  MaxEigenvec_ProjZ = 21,
92  ParallelDiffusivity = 22,
93  PerpendicularDiffusivity = 23,
94  ColorOrientationMiddleEigenvector = 24,
95  ColorOrientationMinEigenvector = 25
96  };
97 
98  static bool ScalarInvariantHasKnownScalarRange(int ScalarInvariant);
99  static void ScalarInvariantKnownScalarRange(int ScalarInvariant, double range[2]);
100 
101  //--------------------------------------------------------------------------
103  //--------------------------------------------------------------------------
104 
108  vtkGetMacro(ScalarInvariant, int);
109 
113  vtkSetMacro(ScalarInvariant, int);
114 
118  this->SetScalarInvariant(this->Trace);
119  };
120 
121  //Description:
124  this->SetScalarInvariant(this->RelativeAnisotropy);
125  };
126 
130  this->SetScalarInvariant(this->FractionalAnisotropy);
131  };
132 
136  this->SetScalarInvariant(this->LinearMeasure);
137  };
138 
142  this->SetScalarInvariant(this->PlanarMeasure);
143  };
144 
148  this->SetScalarInvariant(this->SphericalMeasure);
149  }
150 
152 
155  virtual const char * GetScalarInvariantAsString();
156 
157  //--------------------------------------------------------------------------
159  //--------------------------------------------------------------------------
160 
161  enum
162  {
163  Lines = 0,
164  Tubes = 1,
165  Ellipsoids = 2,
166  Superquadrics = 3
167  };
168 
169  //--------------------------------------------------------------------------
171  //--------------------------------------------------------------------------
172 
175  vtkGetMacro(GlyphGeometry, int);
176 
179  //vtkSetMacro(GlyphGeometry, int);
181  void SetGlyphGeometry( int geometry ) {
182  if ( this->GlyphGeometry != geometry )
183  {
184  this->GlyphGeometry = geometry;
185  this->UpdateGlyphSource();
186  this->Modified();
187  }
188  }
189 
191  this->SetGlyphGeometry(this->Lines);
192  };
194  this->SetGlyphGeometry(this->Tubes);
195  };
197  this->SetGlyphGeometry(this->Ellipsoids);
198  };
200  this->SetGlyphGeometry(this->Superquadrics);
201  };
202 
205  int GetFirstGlyphGeometry() {return this->Lines;};
206  int GetLastGlyphGeometry() {return this->Ellipsoids;};
207 
210  virtual const char * GetGlyphGeometryAsString();
211  virtual const char * GetGlyphGeometryAsString(int);
212 
213  //--------------------------------------------------------------------------
215  //--------------------------------------------------------------------------
216 
219  vtkGetMacro(GlyphScaleFactor, double);
220 
223  vtkSetMacro(GlyphScaleFactor, double);
224 
227  vtkGetMacro(GlyphExtractEigenvalues, int);
228  vtkSetMacro(GlyphExtractEigenvalues, int);
229  vtkBooleanMacro(GlyphExtractEigenvalues, int);
230 
231  //--------------------------------------------------------------------------
233  //--------------------------------------------------------------------------
234 
235  enum
236  {
237  Major = 0,
238  Middle = 1,
239  Minor = 2
240  };
241 
244  vtkGetMacro(GlyphEigenvector, int);
245 
248  //vtkSetMacro(GlyphEigenvector, int);
251  //vtkSetMacro(GlyphGeometry, int);
253  void SetGlyphEigenvector( int eigenvector ) {
254  if ( this->GlyphEigenvector != eigenvector )
255  {
256  this->GlyphEigenvector = eigenvector;
257  if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
258  {
260  this->UpdateGlyphSource();
261  }
262 
263  this->Modified();
264  }
265  }
266 
270  this->SetGlyphEigenvector(this->Major);
271  };
272 
276  this->SetGlyphEigenvector(this->Middle);
277  };
278 
282  this->SetGlyphEigenvector(this->Minor);
283  };
284 
287  int GetFirstGlyphEigenvector() {return this->Major;};
288  int GetLastGlyphEigenvector() {return this->Minor;};
289 
292  virtual const char * GetGlyphEigenvectorAsString();
293  virtual const char * GetGlyphEigenvectorAsString(int);
294 
295  //--------------------------------------------------------------------------
297  //--------------------------------------------------------------------------
298 
301  vtkGetMacro(LineGlyphResolution, int);
302  //vtkSetMacro(LineGlyphResolution, int);
303  void SetLineGlyphResolution( int resolution ) {
304  if ( this->LineGlyphResolution != resolution )
305  {
306  this->LineGlyphResolution = resolution;
307  if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
308  {
310  this->UpdateGlyphSource();
311  }
312 
313  this->Modified();
314  }
315  }
316 
317  //--------------------------------------------------------------------------
319  //--------------------------------------------------------------------------
320 
323  vtkGetMacro(TubeGlyphRadius, double);
324 
327  //vtkSetMacro(TubeGlyphRadius, double);
328  void SetTubeGlyphRadius( double radius ) {
329  if ( this->TubeGlyphRadius != radius )
330  {
331  this->TubeGlyphRadius = radius;
332  if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
333  {
335  this->UpdateGlyphSource();
336  }
337 
338  this->Modified();
339  }
340  }
341 
344  vtkGetMacro(TubeGlyphNumberOfSides, int);
345  //vtkSetMacro(TubeGlyphNumberOfSides, int);
346  void SetTubeGlyphNumberOfSides( int numberOfSides ) {
347  if ( this->TubeGlyphNumberOfSides != numberOfSides )
348  {
349  this->TubeGlyphNumberOfSides = numberOfSides;
350  if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
351  {
353  this->UpdateGlyphSource();
354  }
355 
356  this->Modified();
357  }
358  }
359  //--------------------------------------------------------------------------
361  //--------------------------------------------------------------------------
362 
366  vtkGetMacro(EllipsoidGlyphThetaResolution, int);
367  vtkSetMacro(EllipsoidGlyphThetaResolution, int);
368 
372  vtkGetMacro(EllipsoidGlyphPhiResolution, int);
373  vtkSetMacro(EllipsoidGlyphPhiResolution, int);
374 
375  //--------------------------------------------------------------------------
377  //--------------------------------------------------------------------------
378 
380  vtkGetMacro(SuperquadricGlyphGamma, double);
381  vtkSetMacro(SuperquadricGlyphGamma, double);
382 
384  vtkGetMacro(SuperquadricGlyphThetaResolution, int);
385  vtkSetMacro(SuperquadricGlyphThetaResolution, int);
386 
388  vtkGetMacro(SuperquadricGlyphPhiResolution, int);
389  vtkSetMacro(SuperquadricGlyphPhiResolution, int);
390 
391  //--------------------------------------------------------------------------
393  //--------------------------------------------------------------------------
394 
398  vtkGetMacro(ColorGlyphBy, int);
399 
403  vtkSetMacro(ColorGlyphBy, int);
404 
407  static int GetFirstColorGlyphBy();
408  static int GetLastColorGlyphBy();
409 
412  virtual const char * GetColorGlyphByAsString();
413 
417  this->SetColorGlyphBy(this->Trace);
418  };
419 
423  this->SetColorGlyphBy(this->FractionalAnisotropy);
424  };
425 
429  this->SetColorGlyphBy(this->LinearMeasure);
430  };
431 
433 
434  //--------------------------------------------------------------------------
436  //--------------------------------------------------------------------------
437 
441  vtkGetObjectMacro( GlyphConnection, vtkAlgorithmOutput );
442 
443  //Helper function to get the string of Scalar enums
444  static const char *GetScalarEnumAsString(int val);
446  static int GetFirstScalarInvariant();
447  static int GetLastScalarInvariant();
448 
452  return nullptr;
453  }
454 
455  protected:
460 
461  void UpdateGlyphSource ( );
462 
464 
467 
474 
477 
481 
485 
490 
492 
496  virtual void SetGlyphConnection(vtkAlgorithmOutput* glyphPort);
497  vtkAlgorithmOutput * GlyphConnection;
498 
501 
503 };
504 
505 #endif
506 
void SetScalarInvariantToSphericalMeasure()
Set scalar invariant to C_S (Westin's spherical measure)
void SetScalarInvariantToFractionalAnisotropy()
Set scalar invariant to FA (normalized variance of eigenvalues)
void SetScalarInvariantToRelativeAnisotropy()
Set scalar invariant to relative anisotropy.
int GetFirstGlyphEigenvector()
Return the lowest and highest integers, for use in looping
void operator=(const vtkMRMLColorTableNode &)
void SetScalarInvariantToTrace()
Set scalar invariant to trace (sum of eigenvalues).
void SetScalarInvariantToPlanarMeasure()
Set scalar invariant to C_P (Westin's planar measure)
void PrintSelf(ostream &os, vtkIndent indent) override
void ReadXMLAttributes(const char **atts) override
Set node attributes
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object
void ColorGlyphByTrace()
Set scalar invariant to trace (sum of eigenvalues).
void SetScalarInvariantToLinearMeasure()
Set scalar invariant to C_L (Westin's linear measure)
int ScalarInvariant
-— Parameters that should be written to MRML — //
void ColorGlyphByLinearMeasure()
Set scalar invariant to FA (normalized variance of eigenvalues)
void SetTubeGlyphRadius(double radius)
Set the radius of the tube glyph
int GetFirstGlyphGeometry()
Return the lowest and highest integers, for use in looping
A superclass for other storage nodes.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void SetGlyphEigenvector(int eigenvector)
Set the type of glyph geometry (line, ellipsoid, etc.)
static vtkMRMLColorTableNode * New()
vtkMRMLStorageNode * CreateDefaultStorageNode() override
Create default storage node or nullptr if does not have one
void ColorGlyphByFractionalAnisotropy()
Set scalar invariant to FA (normalized variance of eigenvalues)
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void Modified() override
Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent.
Definition: vtkMRMLNode.h:515
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
MRML node to represent discrete color information.
void SetGlyphGeometry(int geometry)
Set the type of glyph geometry (line, ellipsoid, etc.)