Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkTensorModel.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _MITK_TensorModel_H
18 #define _MITK_TensorModel_H
19 
21 #include <itkDiffusionTensor3D.h>
22 
23 namespace mitk {
24 
30 template< class ScalarType = double >
31 class TensorModel : public DiffusionSignalModel< ScalarType >
32 {
33 public:
34 
35  TensorModel();
36  template< class OtherType >TensorModel(TensorModel<OtherType>* model)
37  {
38  this->m_CompartmentId = model->m_CompartmentId;
39  this->m_T2 = model->GetT2();
40  this->m_FiberDirection = model->GetFiberDirection();
41  this->m_GradientList = model->GetGradientList();
43  this->m_RandGen = model->GetRandomGenerator();
44 
45  this->m_BValue = model->GetBvalue();
46  this->m_KernelDirection = model->GetKernelDirection();
48  }
49  ~TensorModel();
50 
52  typedef itk::DiffusionTensor3D< ScalarType > ItkTensorType;
55 
57  PixelType SimulateMeasurement();
58  ScalarType SimulateMeasurement(unsigned int dir);
59 
60  void SetBvalue(double bValue) { m_BValue = bValue; }
61  double GetBvalue() { return m_BValue; }
62  void SetDiffusivity1(double d1){ m_KernelTensorMatrix[0][0] = d1; }
63  void SetDiffusivity2(double d2){ m_KernelTensorMatrix[1][1] = d2; }
64  void SetDiffusivity3(double d3){ m_KernelTensorMatrix[2][2] = d3; }
65  double GetDiffusivity1() { return m_KernelTensorMatrix[0][0]; }
66  double GetDiffusivity2() { return m_KernelTensorMatrix[1][1]; }
67  double GetDiffusivity3() { return m_KernelTensorMatrix[2][2]; }
68 
69  void SetFiberDirection(GradientType fiberDirection){ this->m_FiberDirection = fiberDirection; }
70  void SetGradientList(GradientListType gradientList) { this->m_GradientList = gradientList; }
71  GradientType GetKernelDirection(){ return m_KernelDirection; }
72  vnl_matrix_fixed<double, 3, 3> GetKernelTensorMatrix(){ return m_KernelTensorMatrix; }
73 
74 protected:
75 
77  void UpdateKernelTensor();
78  GradientType m_KernelDirection;
79  vnl_matrix_fixed<double, 3, 3> m_KernelTensorMatrix;
80  double m_BValue;
81 };
82 
83 }
84 
85 #include "mitkTensorModel.cpp"
86 
87 #endif
88 
double GetDiffusivity2()
GradientType m_FiberDirection
Needed to generate anisotropc signal to determin direction of anisotropy.
DiffusionSignalModel< ScalarType >::GradientListType GradientListType
vnl_matrix_fixed< double, 3, 3 > m_KernelTensorMatrix
3x3 matrix containing the kernel tensor values
double GetDiffusivity1()
unsigned int m_CompartmentId
GUI flag. Which compartment is this model assigned to?
Generates diffusion measurement employing a second rank tensor model: e^(-bg^TDg) ...
TensorModel(TensorModel< OtherType > *model)
double m_BValue
b-value used to generate the artificial signal
void UpdateKernelTensor()
double ScalarType
DataCollection - Class to facilitate loading/accessing structured data.
ItkRandGenType::Pointer m_RandGen
Random number generator.
GradientListType m_GradientList
Diffusion gradient direction container.
ItkDoubleImgType::Pointer m_VolumeFractionImage
Tissue specific volume fraction for each voxel (only relevant for non fiber compartments) ...
std::vector< GradientType > GradientListType
void SetGradientList(GradientListType gradientList)
Abstract class for diffusion signal models.
void SetDiffusivity3(double d3)
itk::Vector< double, 3 > GradientType
double GetDiffusivity3()
DiffusionSignalModel< ScalarType >::GradientType GradientType
GradientType m_KernelDirection
Direction of the kernel tensors principal eigenvector.
void SetDiffusivity1(double d1)
PixelType SimulateMeasurement()
void SetFiberDirection(GradientType fiberDirection)
itk::DiffusionTensor3D< ScalarType > ItkTensorType
void SetDiffusivity2(double d2)
ItkDoubleImgType::Pointer GetVolumeFractionImage()
vnl_matrix_fixed< double, 3, 3 > GetKernelTensorMatrix()
DiffusionSignalModel< ScalarType >::PixelType PixelType
void SetBvalue(double bValue)
b-value used to generate the artificial signal
double m_T2
Tissue specific transversal relaxation time.
GradientType GetKernelDirection()
ItkRandGenType::Pointer GetRandomGenerator()