itkDTITubeSpatialObjectPoint.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 ITK_EXPORT 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
00052
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 }
00119
00120 #ifndef ITK_MANUAL_INSTANTIATION
00121 #include "itkDTITubeSpatialObjectPoint.txx"
00122 #endif
00123
00124 #endif // __itkDTITubeSpatialObjectPoint_h
00125