ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkVesselEnhancingDiffusion3DImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: itkVesselEnhancingDiffusion3DImageFilter.h
5  Language: C++
6  Date: $Date$
7  Version: $Revision$
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef itkVesselEnhancingDiffusion3DImageFilter_h
18 #define itkVesselEnhancingDiffusion3DImageFilter_h
19 
20 #include "itkImageToImageFilter.h"
21 #include <vector>
22 
23 namespace itk
24 {
25 
73 template <class PixelType = short int, unsigned int NDimension = 3>
75  public ImageToImageFilter<Image<PixelType, NDimension> ,
76  Image<PixelType, NDimension> >
77 {
78 
79 public:
80  typedef float Precision;
83 
88 
89  itkNewMacro(Self);
91 
92  itkSetMacro(TimeStep, Precision);
93  itkSetMacro(Iterations, unsigned int);
94  itkSetMacro(RecalculateVesselness, unsigned int);
95 
96  itkSetMacro(Alpha, Precision);
97  itkSetMacro(Beta, Precision);
98  itkSetMacro(Gamma, Precision);
99 
100  itkSetMacro(Epsilon, Precision);
101  itkSetMacro(Omega, Precision);
102  itkSetMacro(Sensitivity, Precision);
103 
104  void SetScales(const std::vector<Precision> scales)
105  {
106  m_Scales = scales;
107  }
108  itkBooleanMacro(DarkObjectLightBackground);
109  itkSetMacro(DarkObjectLightBackground,bool);
110  itkBooleanMacro(Verbose);
111  itkSetMacro(Verbose,bool);
112 
113  // some defaults for lowdose example
114  // used in the paper
116  {
117  m_TimeStep = 0.001;
118  m_Iterations = 30;
119  m_RecalculateVesselness = 100;
120  m_Alpha = 0.5;
121  m_Beta = 0.5;
122  m_Gamma = 5.0;
123  m_Epsilon = 0.01;
124  m_Omega = 25.0;
125  m_Sensitivity = 5.0;
126 
127  m_Scales.resize(5);
128  m_Scales[0] = 0.300;
129  m_Scales[1] = 0.482;
130  m_Scales[2] = 0.775;
131  m_Scales[3] = 1.245;
132  m_Scales[4] = 2.000;
133 
134  m_DarkObjectLightBackground = false;
135  m_Verbose = true;
136  }
137 
138 protected:
141  void PrintSelf(std::ostream &os, Indent indent) const;
142  void GenerateData();
143 
144 private:
145 
147  void operator=(const Self&);
148 
150  unsigned int m_Iterations;
158  std::vector<Precision> m_Scales;
160  bool m_Verbose;
161  unsigned int m_CurrentIteration;
162 
163  // current hessian for which we have max vesselresponse
170 
171  void VED3DSingleIteration (typename PrecisionImageType::Pointer );
172 
173  // Calculates maxvessel response of the range
174  // of scales and stores the hessian of each voxel
175  // into the member images m_Dij.
176  void MaxVesselResponse (const typename PrecisionImageType::Pointer);
177 
178  // calculates diffusion tensor
179  // based on current values of hessian (for which we have
180  // maximim vessel response).
181  void DiffusionTensor();
182 
183  // Sorted magnitude increasing
184  inline Precision VesselnessFunction3D ( Precision, Precision, Precision );
185 };
186 
187 
188 } // end namespace itk
189 
190 #ifndef ITK_MANUAL_INSTANTIATION
191 #include "itkVesselEnhancingDiffusion3DImageFilter.hxx"
192 #endif
193 
194 #endif
Light weight base class for most itk classes.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Templated n-dimensional image class.
Definition: itkImage.h:75