Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
19
20// VTK includes
21class vtkPolyData;
22class vtkAlgorithmOutput;
23
36{
37 public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
42 //--------------------------------------------------------------------------
44 //--------------------------------------------------------------------------
45
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,
81 D11 = 11,
82 D22 = 12,
83 D33 = 13,
84 Mode = 14,
96 };
97
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:
126
132
138
144
150
152
155 virtual const char * GetScalarInvariantAsString();
156
157 //--------------------------------------------------------------------------
159 //--------------------------------------------------------------------------
160
161 enum
162 {
163 Lines = 0,
164 Tubes = 1,
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 };
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,
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
368
374
375 //--------------------------------------------------------------------------
377 //--------------------------------------------------------------------------
378
380 vtkGetMacro(SuperquadricGlyphGamma, double);
381 vtkSetMacro(SuperquadricGlyphGamma, double);
382
386
390
391 //--------------------------------------------------------------------------
393 //--------------------------------------------------------------------------
394
398 vtkGetMacro(ColorGlyphBy, int);
399
403 vtkSetMacro(ColorGlyphBy, int);
404
409
412 virtual const char * GetColorGlyphByAsString();
413
417 this->SetColorGlyphBy(this->Trace);
418 };
419
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);
448
452 return nullptr;
453 }
454
455 protected:
460
462
464
467
474
477
481
485
490
492
496 virtual void SetGlyphConnection(vtkAlgorithmOutput* glyphPort);
497 vtkAlgorithmOutput * GlyphConnection;
498
501
503};
504
505#endif
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void operator=(const vtkMRMLDiffusionTensorDisplayPropertiesNode &)
virtual const char * GetGlyphGeometryAsString()
Return a text string describing the GlyphGeometry variable.
int GetFirstGlyphGeometry()
Return the lowest and highest integers, for use in looping.
void SetGlyphEigenvector(int eigenvector)
Set the type of glyph geometry (line, ellipsoid, etc.)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
static int GetFirstColorGlyphBy()
Return the lowest and highest integers, for use in looping.
vtkMRMLDiffusionTensorDisplayPropertiesNode(const vtkMRMLDiffusionTensorDisplayPropertiesNode &)
virtual const char * GetScalarInvariantAsString()
TO DO: add the rest of the scalars.
static const char * GetScalarEnumAsString(int val)
void ColorGlyphByTrace()
Set scalar invariant to trace (sum of eigenvalues).
void SetScalarInvariantToPlanarMeasure()
Set scalar invariant to C_P (Westin's planar measure)
static bool ScalarInvariantHasKnownScalarRange(int ScalarInvariant)
void SetTubeGlyphRadius(double radius)
Set the radius of the tube glyph.
vtkMRMLStorageNode * CreateDefaultStorageNode() override
Create default storage node or nullptr if does not have one.
void SetScalarInvariantToLinearMeasure()
Set scalar invariant to C_L (Westin's linear measure)
void SetScalarInvariantToRelativeAnisotropy()
Set scalar invariant to relative anisotropy.
void ColorGlyphByLinearMeasure()
Set scalar invariant to FA (normalized variance of eigenvalues)
void SetGlyphGeometry(int geometry)
Set the type of glyph geometry (line, ellipsoid, etc.)
static void ScalarInvariantKnownScalarRange(int ScalarInvariant, double range[2])
static vtkMRMLDiffusionTensorDisplayPropertiesNode * New()
virtual const char * GetColorGlyphByAsString()
Return a text string describing the ColorGlyphBy.
int GetFirstGlyphEigenvector()
Return the lowest and highest integers, for use in looping.
virtual const char * GetGlyphEigenvectorAsString(int)
void ColorGlyphByFractionalAnisotropy()
Set scalar invariant to FA (normalized variance of eigenvalues)
void PrintSelf(ostream &os, vtkIndent indent) override
virtual const char * GetGlyphGeometryAsString(int)
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
virtual void SetGlyphConnection(vtkAlgorithmOutput *glyphPort)
-— End of parameters that should be written to MRML — //
void SetScalarInvariantToFractionalAnisotropy()
Set scalar invariant to FA (normalized variance of eigenvalues)
virtual const char * GetGlyphEigenvectorAsString()
Return a text string describing GlyphEigenvector variable.
int ScalarInvariant
-— Parameters that should be written to MRML — //
static int GetFirstScalarInvariant()
Return the lowest and highest integers, for use in looping.
void SetScalarInvariantToSphericalMeasure()
Set scalar invariant to C_S (Westin's spherical measure)
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object.
void SetScalarInvariantToTrace()
Set scalar invariant to trace (sum of eigenvalues).
void ReadXMLAttributes(const char **atts) override
Read node attributes from a MRML file in XML format.
Abstract Superclass for all specific types of MRML nodes.
void Modified() override
Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent.
A superclass for other storage nodes.