VMTK
Loading...
Searching...
No Matches
vtkvmtkVesselEnhancingDiffusion3DImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 Portions of this code are covered under the ITK copyright.
13 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm
14 for details.
15
16 This software is distributed WITHOUT ANY WARRANTY; without even
17 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18 PURPOSE. See the above copyright notices for more information.
19
20=========================================================================*/
21
44
45#ifndef __vtkvmtkVesselEnhancingDiffusion3DImageFilter_h
46#define __vtkvmtkVesselEnhancingDiffusion3DImageFilter_h
47
48
49#include "vtkvmtkITKImageToImageFilterFF.h"
51#include "vtkvmtkWin32Header.h"
52#include "vtkVersion.h"
53
54class VTK_VMTK_SEGMENTATION_EXPORT vtkvmtkVesselEnhancingDiffusion3DImageFilter : public vtkvmtkITKImageToImageFilterFF
55{
56 public:
58 vtkTypeMacro(vtkvmtkVesselEnhancingDiffusion3DImageFilter, vtkvmtkITKImageToImageFilterFF);
59
61
66 vtkSetMacro(SigmaMin,double);
67 vtkGetMacro(SigmaMin,double);
69
71
76 vtkSetMacro(SigmaMax,double);
77 vtkGetMacro(SigmaMax,double);
79
81
85 vtkSetMacro(NumberOfSigmaSteps,int);
86 vtkGetMacro(NumberOfSigmaSteps,int);
88
97
106
111 void SetTimeStep(double value)
112 {
114 }
115
120 void SetEpsilon(double value)
121 {
123 }
124
130 void SetOmega(double value)
131 {
133 }
134
139 void SetSensitivity(double value)
140 {
142 }
143
148 void SetNumberOfIterations(int value)
149 {
150 DelegateITKInputMacro(SetIterations,value);
151 }
152
157 void SetAlpha(double value)
158 {
160 }
161
167 void SetBeta(double value)
168 {
170 }
171
176 void SetGamma(double value)
177 {
179 }
180
190
196 double ComputeSigmaValue(int scaleLevel)
197 {
198 double sigmaValue;
199
200 if (this->NumberOfSigmaSteps < 2)
201 {
202 return this->SigmaMin;
203 }
204
205 switch (this->SigmaStepMethod)
206 {
207 case EQUISPACED_STEPS:
208 {
209 double stepSize = ( SigmaMax - SigmaMin ) / (NumberOfSigmaSteps-1);
210 if (stepSize < 1e-10)
211 {
212 stepSize = 1e-10;
213 }
214 sigmaValue = SigmaMin + stepSize * scaleLevel;
215 break;
216 }
218 {
219 double stepSize = ( vcl_log(SigmaMax) - vcl_log(SigmaMin) ) / (NumberOfSigmaSteps-1);
220 if (stepSize < 1e-10)
221 {
222 stepSize = 1e-10;
223 }
224 sigmaValue = vcl_exp( vcl_log (SigmaMin) + stepSize * scaleLevel);
225 break;
226 }
227 default:
228 vtkErrorMacro("Error: undefined sigma step method.");
229 sigmaValue = 0.0;
230 break;
231 }
232
233 return sigmaValue;
234 }
235
240 void Update()
241 {
242 std::vector<float> scales;
243 for (int i=0; i<this->NumberOfSigmaSteps; i++)
244 {
245 scales.push_back(this->ComputeSigmaValue(i));
246 }
247 this->GetImageFilterPointer()->SetScales(scales);
248 }
249
250//BTX
255 enum
256 {
259 };
260//ETX
261
262protected:
263 //BTX
265
267 {
268 this->SigmaMin = 0.0;
269 this->SigmaMax = 0.0;
270 this->NumberOfSigmaSteps = 0;
272
273 this->GetImageFilterPointer()->SetDefaultPars();
274 }
275
277 ImageFilterType* GetImageFilterPointer() { return dynamic_cast<ImageFilterType*>(m_Filter.GetPointer()); }
278 //ETX
279
280 double SigmaMin;
281 double SigmaMax;
284
285private:
287 void operator=(const vtkvmtkVesselEnhancingDiffusion3DImageFilter&); // Not implemented.
288};
289
290#endif
291
292
293
294
Enhances tubular (vessel-like) structures in a 3D image via anisotropic diffusion guided by the local...
static vtkvmtkVesselEnhancingDiffusion3DImageFilter * New()
itk::VesselEnhancingDiffusion3DImageFilter< Superclass::InputImageType::PixelType > ImageFilterType
#define DelegateITKInputMacro(name, arg)