vtkMRMLDiffusionTensorDisplayPropertiesNode.h

Go to the documentation of this file.
00001 /*=auto=========================================================================
00002 
00003   Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
00004 
00005   See Doc/copyright/copyright.txt
00006   or http://www.slicer.org/copyright/copyright.txt for details.
00007 
00008   Program:   3D Slicer
00009   Module:    $RCSfile: ,v $
00010   Date:      $Date: 2006/03/19 17:12:29 $
00011   Version:   $Revision: 1.3 $
00012 
00013   =========================================================================auto=*/
00025 //
00026 
00027 #ifndef __vtkMRMLDiffusionTensorDisplayPropertiesNode_h
00028 #define __vtkMRMLDiffusionTensorDisplayPropertiesNode_h
00029 
00030 #include "vtkMRML.h"
00031 #include "vtkMRMLColorTableNode.h"
00032 #include "vtkPolyData.h"
00033 
00034 
00035 class VTK_MRML_EXPORT vtkMRMLDiffusionTensorDisplayPropertiesNode : public vtkMRMLColorTableNode
00036 {
00037  public:
00038   static vtkMRMLDiffusionTensorDisplayPropertiesNode *New();
00039   vtkTypeMacro(vtkMRMLDiffusionTensorDisplayPropertiesNode,vtkMRMLColorTableNode);
00040   void PrintSelf(ostream& os, vtkIndent indent);
00041 
00042   //--------------------------------------------------------------------------
00044   //--------------------------------------------------------------------------
00045 
00046   virtual vtkMRMLNode* CreateNodeInstance();
00047 
00050   virtual void ReadXMLAttributes( const char** atts);
00051 
00054   virtual void WriteXML(ostream& of, int indent);
00055 
00058   virtual void Copy(vtkMRMLNode *node);
00059 
00062   virtual const char* GetNodeTagName() {return "DiffusionTensorDisplayProperties";};
00063 
00064   //--------------------------------------------------------------------------
00066   //--------------------------------------------------------------------------
00067 
00068   //BTX
00069   enum
00070   {
00071     Trace = 0,
00072     Determinant = 1,
00073     RelativeAnisotropy = 2,
00074     FractionalAnisotropy = 3,
00075     MaxEigenvalue = 4,
00076     MidEigenvalue = 5,
00077     MinEigenvalue = 6,
00078     LinearMeasure = 7,
00079     PlanarMeasure = 8,
00080     SphericalMeasure = 9,
00081     ColorOrientation = 10,
00082     D11 = 11,
00083     D22 = 12,
00084     D33 = 13,
00085     Mode = 14,
00086     ColorMode = 15,
00087     MaxEigenvalueProjX = 16,
00088     MaxEigenvalueProjY = 17,
00089     MaxEigenvalueProjZ = 18,
00090     MaxEigenvec_ProjX =  19,
00091     MaxEigenvec_ProjY =  20,
00092     MaxEigenvec_ProjZ =  21,
00093     ParallelDiffusivity =  22,
00094     PerpendicularDiffusivity =  23,
00095     ColorOrientationMiddleEigenvector = 24,
00096     ColorOrientationMinEigenvector = 25
00097   };
00098   //ETX
00099 
00100   //--------------------------------------------------------------------------
00102   //--------------------------------------------------------------------------
00103 
00107   vtkGetMacro(ScalarInvariant, int);
00108 
00112   vtkSetMacro(ScalarInvariant, int);
00113  
00116   void SetScalarInvariantToTrace() {
00117     this->SetScalarInvariant(this->Trace);
00118   };
00119 
00120   //Description:
00122   void SetScalarInvariantToRelativeAnisotropy() {
00123     this->SetScalarInvariant(this->RelativeAnisotropy);
00124   };
00125 
00128   void SetScalarInvariantToFractionalAnisotropy() {
00129     this->SetScalarInvariant(this->FractionalAnisotropy);
00130   };
00131 
00134   void SetScalarInvariantToLinearMeasure() {
00135     this->SetScalarInvariant(this->LinearMeasure);
00136   };
00137 
00140   void SetScalarInvariantToPlanarMeasure() {
00141     this->SetScalarInvariant(this->PlanarMeasure);
00142   };
00143 
00146   void SetScalarInvariantToSphericalMeasure() {
00147     this->SetScalarInvariant(this->SphericalMeasure);
00148   }
00149 
00151 
00154   int GetFirstScalarInvariant() {return this->Trace;};
00155   int GetLastScalarInvariant() {return this->ColorOrientationMinEigenvector;};
00156 
00159   virtual const char * GetScalarInvariantAsString();
00160 
00161 
00162   //--------------------------------------------------------------------------
00164   //--------------------------------------------------------------------------
00165 
00166   //BTX
00167   enum
00168   {
00169     Lines = 0,
00170     Tubes = 1,
00171     Ellipsoids = 2,
00172     Superquadrics = 3
00173   };
00174   //ETX
00175 
00176   //--------------------------------------------------------------------------
00178   //--------------------------------------------------------------------------
00179 
00182   vtkGetMacro(GlyphGeometry, int);
00183 
00186   //vtkSetMacro(GlyphGeometry, int);
00188   void SetGlyphGeometry( int geometry ) {
00189 
00190     if ( this->GlyphGeometry != geometry ) 
00191       {
00192       this->GlyphGeometry = geometry;
00193       this->UpdateGlyphSource();
00194       this->Modified();
00195       }
00196   }
00197 
00198   void SetGlyphGeometryToLines() {
00199     this->SetGlyphGeometry(this->Lines);
00200   };
00201   void SetGlyphGeometryToTubes() {
00202     this->SetGlyphGeometry(this->Tubes);
00203   };
00204   void SetGlyphGeometryToEllipsoids() {
00205     this->SetGlyphGeometry(this->Ellipsoids);
00206   };
00207   void SetGlyphGeometryToSuperquadrics() {
00208     this->SetGlyphGeometry(this->Superquadrics);
00209   };
00210 
00211 
00214   int GetFirstGlyphGeometry() {return this->Lines;};
00215   int GetLastGlyphGeometry() {return this->Ellipsoids;};
00216 
00219   virtual const char * GetGlyphGeometryAsString();
00220 
00221   //--------------------------------------------------------------------------
00223   //--------------------------------------------------------------------------
00224 
00227   vtkGetMacro(GlyphScaleFactor, double);
00228 
00231   vtkSetMacro(GlyphScaleFactor, double);
00232 
00235   vtkGetMacro(GlyphExtractEigenvalues, int);
00236   vtkSetMacro(GlyphExtractEigenvalues, int);
00237   vtkBooleanMacro(GlyphExtractEigenvalues, int);
00238 
00239   //--------------------------------------------------------------------------
00241   //--------------------------------------------------------------------------
00242 
00243   //BTX
00244   enum
00245   {
00246     Major = 1,
00247     Middle = 2,
00248     Minor = 3
00249   };
00250   //ETX
00251 
00254   vtkGetMacro(GlyphEigenvector, int);
00255 
00258   //vtkSetMacro(GlyphEigenvector, int);
00261   //vtkSetMacro(GlyphGeometry, int);
00263   void SetGlyphEigenvector( int eigenvector ) {
00264 
00265     if ( this->GlyphEigenvector != eigenvector ) 
00266       {
00267       this->GlyphEigenvector = eigenvector;
00268       if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
00269         {
00271         this->UpdateGlyphSource();
00272         }
00273 
00274       this->Modified();
00275       }
00276   }
00277 
00280   void SetGlyphEigenvectorToMajor() {
00281     this->SetGlyphEigenvector(this->Major);
00282   };
00283 
00286   void SetGlyphEigenvectorToMiddle() {
00287     this->SetGlyphEigenvector(this->Middle);
00288   };
00289 
00292   void SetGlyphEigenvectorToMinor() {
00293     this->SetGlyphEigenvector(this->Minor);
00294   };
00295 
00298   int GetFirstGlyphEigenvector() {return this->Major;};
00299   int GetLastGlyphEigenvector() {return this->Minor;};
00300 
00303   virtual const char * GetGlyphEigenvectorAsString();
00304 
00305   
00306   //--------------------------------------------------------------------------
00308   //--------------------------------------------------------------------------
00309 
00312   vtkGetMacro(LineGlyphResolution, int);
00313   //vtkSetMacro(LineGlyphResolution, int);
00314   void SetLineGlyphResolution( int resolution ) {
00315 
00316     if ( this->LineGlyphResolution != resolution ) 
00317       {
00318       this->LineGlyphResolution = resolution;
00319       if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
00320         {
00322         this->UpdateGlyphSource();
00323         }
00324 
00325       this->Modified();
00326       }
00327   }
00328 
00329   //--------------------------------------------------------------------------
00331   //--------------------------------------------------------------------------
00332 
00335   vtkGetMacro(TubeGlyphRadius, double);
00336 
00339   //vtkSetMacro(TubeGlyphRadius, double);
00340   void SetTubeGlyphRadius( double radius ) {
00341 
00342     if ( this->TubeGlyphRadius != radius ) 
00343       {
00344       this->TubeGlyphRadius = radius;
00345       if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
00346         {
00348         this->UpdateGlyphSource();
00349         }
00350 
00351       this->Modified();
00352       }
00353   }
00354 
00357   vtkGetMacro(TubeGlyphNumberOfSides, int);
00358   //vtkSetMacro(TubeGlyphNumberOfSides, int);
00359   void SetTubeGlyphNumberOfSides( int numberOfSides ) {
00360 
00361     if ( this->TubeGlyphNumberOfSides != numberOfSides ) 
00362       {
00363       this->TubeGlyphNumberOfSides = numberOfSides;
00364       if ( this->GlyphGeometry == this->Lines || this->GlyphGeometry == this->Tubes)
00365         {
00367         this->UpdateGlyphSource();
00368         }
00369 
00370       this->Modified();
00371       }
00372   }
00373   //--------------------------------------------------------------------------
00375   //--------------------------------------------------------------------------
00376 
00380   vtkGetMacro(EllipsoidGlyphThetaResolution, int);
00381   vtkSetMacro(EllipsoidGlyphThetaResolution, int);
00382 
00386   vtkGetMacro(EllipsoidGlyphPhiResolution, int);
00387   vtkSetMacro(EllipsoidGlyphPhiResolution, int);
00388 
00389   //--------------------------------------------------------------------------
00391   //--------------------------------------------------------------------------
00392 
00394   vtkGetMacro(SuperquadricGlyphGamma, double);
00395   vtkSetMacro(SuperquadricGlyphGamma, double);
00396 
00398   vtkGetMacro(SuperquadricGlyphThetaResolution, int);
00399   vtkSetMacro(SuperquadricGlyphThetaResolution, int);
00400 
00402   vtkGetMacro(SuperquadricGlyphPhiResolution, int);
00403   vtkSetMacro(SuperquadricGlyphPhiResolution, int);
00404 
00405   //--------------------------------------------------------------------------
00407   //--------------------------------------------------------------------------
00408 
00412   vtkGetMacro(ColorGlyphBy, int);
00413 
00417   vtkSetMacro(ColorGlyphBy, int);
00418 
00421   int GetFirstColorGlyphBy() {return this->Trace;};
00422   int GetLastColorGlyphBy() {return this->ColorOrientationMinEigenvector;};
00423   
00426   virtual const char * GetColorGlyphByAsString();
00427  
00430   void ColorGlyphByTrace() {
00431     this->SetColorGlyphBy(this->Trace);
00432   };
00433 
00436   void ColorGlyphByFractionalAnisotropy() {
00437     this->SetColorGlyphBy(this->FractionalAnisotropy);
00438   };  
00439 
00442   void ColorGlyphByLinearMeasure() {
00443     this->SetColorGlyphBy(this->LinearMeasure);
00444   };  
00445 
00447 
00448   //--------------------------------------------------------------------------
00450   //--------------------------------------------------------------------------
00451 
00455   vtkGetObjectMacro( GlyphSource, vtkPolyData );
00456 
00457  //Helper function to get the string of Scalar enums
00458   static const char *GetScalarEnumAsString(int val);
00459 
00460  protected:
00461   vtkMRMLDiffusionTensorDisplayPropertiesNode();
00462   ~vtkMRMLDiffusionTensorDisplayPropertiesNode();
00463   vtkMRMLDiffusionTensorDisplayPropertiesNode(const vtkMRMLDiffusionTensorDisplayPropertiesNode&);
00464   void operator=(const vtkMRMLDiffusionTensorDisplayPropertiesNode&);
00465 
00466   void UpdateGlyphSource ( );
00467 
00469 
00471   int ScalarInvariant;
00472 
00474   int GlyphGeometry;
00475   int ColorGlyphBy;
00476   double GlyphScaleFactor;
00477   int GlyphEigenvector;
00478   int GlyphExtractEigenvalues;
00479 
00481   int LineGlyphResolution;
00482 
00484   double TubeGlyphRadius;
00485   int TubeGlyphNumberOfSides;
00486 
00488   int EllipsoidGlyphThetaResolution;
00489   int EllipsoidGlyphPhiResolution;
00490 
00492   double SuperquadricGlyphGamma;
00493   int SuperquadricGlyphThetaResolution;
00494   int SuperquadricGlyphPhiResolution;
00495 
00497 
00498  
00500   vtkPolyData * GlyphSource;
00501 
00505   vtkSetObjectMacro( GlyphSource, vtkPolyData );
00506 
00507 
00510 
00512 
00513 };
00514 
00515 #endif
00516 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1