Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkDTITubeSpatialObjectPoint.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDTITubeSpatialObjectPoint.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-11-16 15:54:39 $
00007   Version:   $Revision: 1.8 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkDTITubeSpatialObjectPoint_h
00018 #define __itkDTITubeSpatialObjectPoint_h
00019 
00020 #include "itkTubeSpatialObjectPoint.h"
00021 #include "itkCovariantVector.h"
00022 #include "itkDiffusionTensor3D.h"
00023 #include "vnl/vnl_vector_fixed.h"
00024 
00025 namespace itk 
00026 {
00027 
00036 template < unsigned int TPointDimension = 3 >
00037 class DTITubeSpatialObjectPoint 
00038   : public TubeSpatialObjectPoint<TPointDimension>
00039 {
00040 
00041 public:
00042 
00043   typedef DTITubeSpatialObjectPoint                 Self;
00044   typedef SpatialObjectPoint<TPointDimension>       Superclass;
00045   typedef Point< double, TPointDimension >          PointType;
00046   typedef Vector<double, TPointDimension >          VectorType;
00047   typedef CovariantVector<double, TPointDimension > CovariantVectorType;
00048   typedef std::pair<std::string,float>              FieldType;
00049   typedef std::vector<FieldType>                    FieldListType;
00050 
00051   // If you add a type here you need to modify the TranslateEnumToChar
00052   // to translate the enum to a string
00053   typedef enum {FA,ADC,GA} FieldEnumType;
00054 
00057   DTITubeSpatialObjectPoint( void );
00058 
00060   virtual ~DTITubeSpatialObjectPoint( void );
00061 
00063   void SetTensorMatrix(const DiffusionTensor3D<double> & matrix)
00064     {
00065     std::copy(matrix.Begin(), matrix.End(), m_TensorMatrix);
00066     }
00067 
00068   void SetTensorMatrix(const DiffusionTensor3D<float> & matrix)
00069     {
00070     std::copy(matrix.Begin(), matrix.End(), m_TensorMatrix);
00071     }
00072 
00073   void SetTensorMatrix(const float* matrix)
00074     {
00075     for(unsigned int i=0;i<6;i++)
00076       {
00077       m_TensorMatrix[i] = matrix[i];
00078       }
00079     }
00080 
00081   const float* GetTensorMatrix() const {return m_TensorMatrix;}
00082 
00084   Self & operator=(const DTITubeSpatialObjectPoint & rhs);
00085 
00087   void AddField(const char* name,float value);
00088 
00090   void AddField(FieldEnumType name,float value);
00091 
00093   void SetField(FieldEnumType name,float value);
00094   void SetField(const char* name,float value);
00096 
00098   const FieldListType & GetFields() const {return m_Fields;}
00099 
00101   float GetField(const char* name) const;
00102   float GetField(FieldEnumType name) const;
00104 
00105 
00106 protected:
00107 
00108   float m_TensorMatrix[6];
00109   FieldListType m_Fields;
00110 
00112   void PrintSelf( std::ostream & os, Indent indent) const;
00113 
00115   std::string TranslateEnumToChar(FieldEnumType name) const;
00116 };
00117 
00118 } // end of namespace itk
00119 
00120 #ifndef ITK_MANUAL_INSTANTIATION
00121 #include "itkDTITubeSpatialObjectPoint.txx"
00122 #endif
00123 
00124 #endif // __itkDTITubeSpatialObjectPoint_h
00125 

Generated at Mon Apr 14 12:15:01 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000