ITK  5.0.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 <typename PixelType = short int, unsigned int NDimension = 3>
74 class ITK_TEMPLATE_EXPORT VesselEnhancingDiffusion3DImageFilter :
75  public ImageToImageFilter<Image<PixelType, NDimension> ,
76  Image<PixelType, NDimension> >
77 {
78 
79 public:
80  ITK_DISALLOW_COPY_AND_ASSIGN(VesselEnhancingDiffusion3DImageFilter);
81 
82  using Precision = float;
85 
90 
91  itkNewMacro(Self);
93 
94  itkSetMacro(TimeStep, Precision);
95  itkSetMacro(Iterations, unsigned int);
96  itkSetMacro(RecalculateVesselness, unsigned int);
97 
98  itkSetMacro(Alpha, Precision);
99  itkSetMacro(Beta, Precision);
100  itkSetMacro(Gamma, Precision);
101 
102  itkSetMacro(Epsilon, Precision);
103  itkSetMacro(Omega, Precision);
104  itkSetMacro(Sensitivity, Precision);
105 
106  void SetScales(const std::vector<Precision> scales)
107  {
108  m_Scales = scales;
109  }
110  itkBooleanMacro(DarkObjectLightBackground);
111  itkSetMacro(DarkObjectLightBackground,bool);
112  itkBooleanMacro(Verbose);
113  itkSetMacro(Verbose,bool);
114 
115  // some defaults for lowdose example
116  // used in the paper
118  {
119  m_TimeStep = 0.001;
120  m_Iterations = 30;
121  m_RecalculateVesselness = 100;
122  m_Alpha = 0.5;
123  m_Beta = 0.5;
124  m_Gamma = 5.0;
125  m_Epsilon = 0.01;
126  m_Omega = 25.0;
127  m_Sensitivity = 5.0;
128 
129  m_Scales.resize(5);
130  m_Scales[0] = 0.300;
131  m_Scales[1] = 0.482;
132  m_Scales[2] = 0.775;
133  m_Scales[3] = 1.245;
134  m_Scales[4] = 2.000;
135 
136  m_DarkObjectLightBackground = false;
137  m_Verbose = true;
138  }
139 
140 protected:
143  void PrintSelf(std::ostream &os, Indent indent) const override;
144  void GenerateData() override;
145 
146 private:
148  unsigned int m_Iterations;
156  std::vector<Precision> m_Scales;
158  bool m_Verbose;
159  unsigned int m_CurrentIteration;
160 
161  // current hessian for which we have max vesselresponse
168 
169  void VED3DSingleIteration (typename PrecisionImageType::Pointer );
170 
171  // Calculates maxvessel response of the range
172  // of scales and stores the hessian of each voxel
173  // into the member images m_Dij.
174  void MaxVesselResponse (const typename PrecisionImageType::Pointer);
175 
176  // calculates diffusion tensor
177  // based on current values of hessian (for which we have
178  // maximim vessel response).
179  void DiffusionTensor();
180 
181  // Sorted magnitude increasing
182  inline Precision VesselnessFunction3D ( Precision, Precision, Precision );
183 };
184 
185 
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkVesselEnhancingDiffusion3DImageFilter.hxx"
190 #endif
191 
192 #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