Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkGibbsTrackingFilter.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 #ifndef itkGibbsTrackingFilter_h
17 #define itkGibbsTrackingFilter_h
18 
19 // MITK
20 #include <mitkSphereInterpolator.h>
21 
22 // ITK
23 #include <itkProcessObject.h>
24 #include <itkImage.h>
25 #include <itkDiffusionTensor3D.h>
26 #include <itkMersenneTwisterRandomVariateGenerator.h>
27 
28 // VTK
29 #include <vtkSmartPointer.h>
30 #include <vtkPolyData.h>
31 #include <vtkCellArray.h>
32 #include <vtkPoints.h>
33 #include <vtkPolyLine.h>
34 
35 namespace itk{
36 
40 template< class ItkQBallImageType >
41 class GibbsTrackingFilter : public ProcessObject
42 {
43 public:
45  typedef ProcessObject Superclass;
48 
49  itkFactorylessNewMacro(Self)
50  itkCloneMacro(Self)
51  itkTypeMacro( GibbsTrackingFilter, ProcessObject )
52 
53  typedef Image< DiffusionTensor3D<float>, 3 > ItkTensorImage;
54  typedef typename ItkQBallImageType::Pointer ItkQBallImageTypePointer;
55  typedef Image< float, 3 > ItkFloatImageType;
56  typedef vtkSmartPointer< vtkPolyData > FiberPolyDataType;
57 
59  itkSetMacro( StartTemperature, float )
60  itkSetMacro( EndTemperature, float )
61  itkSetMacro( Iterations, double )
62  itkSetMacro( ParticleWeight, float )
63  itkSetMacro( ParticleWidth, float )
64  itkSetMacro( ParticleLength, float )
65  itkSetMacro( ConnectionPotential, float )
66  itkSetMacro( InexBalance, float )
67  itkSetMacro( ParticlePotential, float )
68  itkSetMacro( MinFiberLength, int )
69  itkSetMacro( AbortTracking, bool )
70  itkSetMacro( CurvatureThreshold, float)
71  itkSetMacro( DuplicateImage, bool )
72  itkSetMacro( RandomSeed, int )
73  itkSetMacro( LoadParameterFile, std::string )
74  itkSetMacro( SaveParameterFile, std::string )
75  itkSetMacro( LutPath, std::string )
76 
78  itkGetMacro( ParticleWeight, float )
79  itkGetMacro( ParticleWidth, float )
80  itkGetMacro( ParticleLength, float )
81  itkGetMacro( NumParticles, int )
82  itkGetMacro( NumConnections, int )
83  itkGetMacro( NumAcceptedFibers, int )
84  itkGetMacro( ProposalAcceptance, float )
85  itkGetMacro( CurrentIteration, double)
86  itkGetMacro( Iterations, double)
87  itkGetMacro( IsInValidState, bool)
88  FiberPolyDataType GetFiberBundle();
89 
91  itkSetMacro(QBallImage, typename ItkQBallImageType::Pointer)
92  itkSetMacro(MaskImage, ItkFloatImageType::Pointer)
93  itkSetMacro(TensorImage, ItkTensorImage::Pointer)
94 
95  virtual void Update() override{
96  this->GenerateData();
97  }
98 
99 protected:
100 
101  void GenerateData() override;
102 
104  virtual ~GibbsTrackingFilter();
105  void EstimateParticleWeight();
106  void PrepareMaskImage();
107  bool LoadParameters();
108  bool SaveParameters();
109 
110  // Input Images
114 
115  // Tracking parameters
118  double m_Iterations;
120  unsigned long m_CurrentStep;
130  volatile bool m_BuildFibers;
137  std::string m_LoadParameterFile;
138  std::string m_SaveParameterFile;
139  std::string m_LutPath;
141 
143 
144  //Constant values
145  static const int m_ParticleGridCellCapacity = 1024;
146 };
147 }
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
151 #endif
152 
153 #endif
ItkFloatImageType::Pointer m_MaskImage
itk::SmartPointer< Self > Pointer
Performes global fiber tractography on the input Q-Ball or tensor image (Gibbs tracking, Reisert 2010).
SmartPointer< Self > Pointer
volatile bool m_BuildFibers
set flag to generate fibers from particle grid
STL namespace.
ItkTensorImage::Pointer m_TensorImage
FiberPolyDataType GetFiberBundle()
Output fibers.
bool m_AbortTracking
set flag to abort tracking
int m_MinFiberLength
discard all fibers shortan than the specified length in mm
ItkQBallImageType::Pointer ItkQBallImageTypePointer
SmartPointer< const Self > ConstPointer
int m_NumParticles
current number of particles in grid
float m_ProposalAcceptance
proposal acceptance rate (0-1)
this class encapsulates qball images
double m_Iterations
Total number of iterations.
vtkSmartPointer< vtkPolyData > FiberPolyDataType
int m_RandomSeed
seed value for random generator (-1 for standard seeding)
float m_ConnectionPotential
gross L (chemisches potential, default 10)
float m_InexBalance
gewichtung zwischen den lambdas; -5 ... 5 -> nur intern ... nur extern,default 0
float m_CurvatureThreshold
curvature threshold in radians (1 -> no curvature is accepted, -1 all curvature angles are accepted) ...
Image class for storing images.
Definition: mitkImage.h:76
float m_ParticlePotential
default 0.2
float m_ParticleWeight
w (unitless)
bool m_DuplicateImage
generates a working copy of the qball image so that the original image won't be changed by the mean s...
float m_StartTemperature
Start temperature.
unsigned long m_CurrentStep
current tracking step
int m_NumConnections
current number of connections between particles in grid
double m_CurrentIteration
Current iteration.
FiberPolyDataType m_FiberPolyData
container for reconstructed fibers
this class encapsulates tensor images
bool m_IsInValidState
Whether the filter is in a valid state, false if error occured.
std::string m_LoadParameterFile
filename of parameter file (reader)
std::string m_SaveParameterFile
filename of parameter file (writer)
float m_EndTemperature
End temperature.
int m_NumAcceptedFibers
number of reconstructed fibers generated by the FiberBuilder
virtual void Update() override
ItkQBallImageType::Pointer m_QBallImage
std::string m_LutPath
path to lookuptables used by the sphere interpolator
static const int m_ParticleGridCellCapacity