Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDiffusionSignalModel.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_DiffusionSignalModel_H
18 #define _MITK_DiffusionSignalModel_H
19 
20 #include <MitkFiberTrackingExports.h>
21 #include <itkVariableLengthVector.h>
22 #include <itkVector.h>
23 #include <itkImage.h>
24 #include <itkMersenneTwisterRandomVariateGenerator.h>
25 #include <vnl/vnl_vector_fixed.h>
26 
27 namespace mitk {
28 
34 template< class ScalarType = double >
36 {
37 public:
38 
40  : m_T2(100)
41  , m_T1(0)
42  {}
44 
45  typedef itk::Image<double, 3> ItkDoubleImgType;
47  typedef itk::Vector<double,3> GradientType;
48  typedef std::vector<GradientType> GradientListType;
49  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator ItkRandGenType;
50 
52  virtual PixelType SimulateMeasurement() = 0;
53  virtual ScalarType SimulateMeasurement(unsigned int dir) = 0;
54 
55  virtual void SetFiberDirection(GradientType fiberDirection) = 0;
56  GradientType GetFiberDirection(){ return m_FiberDirection; }
57 
58  virtual void SetGradientList(GradientListType gradientList) = 0;
59  GradientListType GetGradientList(){ return m_GradientList; }
60  GradientType GetGradientDirection(int i) { return m_GradientList.at(i); }
61 
62  void SetT2(double T2) { m_T2 = T2; }
63  double GetT2() { return m_T2; }
64 
65  void SetT1(double T1) { m_T1 = T1; }
66  double GetT1() { return m_T1; }
67 
70 
73 
74  void SetSeed(int s)
75  {
76  if (m_RandGen.IsNull())
78  m_RandGen->SetSeed(s);
79  }
80 
81  unsigned int m_CompartmentId;
82 
83 protected:
84 
85  GradientType m_FiberDirection;
86  GradientListType m_GradientList;
87  double m_T2;
88  double m_T1;
91 };
92 
93 }
94 
95 #endif
96 
double m_T1
Tissue specific longitudinal relaxation time.
itk::Image< double, 3 > ItkDoubleImgType
GradientType m_FiberDirection
Needed to generate anisotropc signal to determin direction of anisotropy.
itk::SmartPointer< Self > Pointer
unsigned int m_CompartmentId
GUI flag. Which compartment is this model assigned to?
double ScalarType
virtual PixelType SimulateMeasurement()=0
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) ...
itk::VariableLengthVector< ScalarType > PixelType
std::vector< GradientType > GradientListType
Abstract class for diffusion signal models.
GradientType GetGradientDirection(int i)
itk::Vector< double, 3 > GradientType
itk::Statistics::MersenneTwisterRandomVariateGenerator ItkRandGenType
virtual void SetGradientList(GradientListType gradientList)=0
void SetRandomGenerator(ItkRandGenType::Pointer randgen)
virtual void SetFiberDirection(GradientType fiberDirection)=0
ItkDoubleImgType::Pointer GetVolumeFractionImage()
void SetVolumeFractionImage(ItkDoubleImgType::Pointer img)
double m_T2
Tissue specific transversal relaxation time.
ItkRandGenType::Pointer GetRandomGenerator()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.