VMTK
vtkvmtkActiveTubeFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: VMTK
4 Module: $RCSfile: .h,v $
5 Language: C++
6 
7  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
8  See LICENSE file for details.
9 
10  Portions of this code are covered under the VTK copyright.
11  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
12  for details.
13 
14  Portions of this code are covered under the ITK copyright.
15  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm
16  for details.
17 
18  This software is distributed WITHOUT ANY WARRANTY; without even
19  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20  PURPOSE. See the above copyright notices for more information.
21 
22 =========================================================================*/
32 #ifndef __vtkvmtkActiveTubeFilter_h
33 #define __vtkvmtkActiveTubeFilter_h
34 
35 #include "vtkPolyDataAlgorithm.h"
36 #include "vtkvmtkWin32Header.h"
37 
38 class vtkImageData;
39 class vtkDoubleArray;
40 
41 class VTK_VMTK_SEGMENTATION_EXPORT vtkvmtkActiveTubeFilter : public vtkPolyDataAlgorithm
42 {
43  public:
44  vtkTypeMacro(vtkvmtkActiveTubeFilter,vtkPolyDataAlgorithm);
45  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
46 
47  static vtkvmtkActiveTubeFilter *New();
48 
49  virtual void SetPotentialImage(vtkImageData *);
50  vtkGetObjectMacro(PotentialImage, vtkImageData);
51 
52  vtkSetStringMacro(RadiusArrayName);
53  vtkGetStringMacro(RadiusArrayName);
54 
55  vtkSetMacro(NumberOfIterations,int);
56  vtkGetMacro(NumberOfIterations,int);
57 
58  vtkSetMacro(PotentialWeight,double);
59  vtkGetMacro(PotentialWeight,double);
60 
61  vtkSetMacro(StiffnessWeight,double);
62  vtkGetMacro(StiffnessWeight,double);
63 
64  vtkSetMacro(Convergence,double);
65  vtkGetMacro(Convergence,double);
66 
67  vtkSetMacro(CFLCoefficient,double);
68  vtkGetMacro(CFLCoefficient,double);
69 
70  vtkSetMacro(MinimumRadius,double);
71  vtkGetMacro(MinimumRadius,double);
72 
73  vtkSetMacro(FixedEndpointCoordinates,int);
74  vtkGetMacro(FixedEndpointCoordinates,int);
75  vtkBooleanMacro(FixedEndpointCoordinates,int);
76 
77  vtkSetMacro(FixedEndpointRadius,int);
78  vtkGetMacro(FixedEndpointRadius,int);
79  vtkBooleanMacro(FixedEndpointRadius,int);
80 
81  vtkSetMacro(NumberOfAngularEvaluations,int);
82  vtkGetMacro(NumberOfAngularEvaluations,int);
83 
84  vtkSetMacro(SplineResamplingWhileIterating,int);
85  vtkGetMacro(SplineResamplingWhileIterating,int);
86  vtkBooleanMacro(SplineResamplingWhileIterating,int);
87 
88  vtkSetMacro(NegativeNormWarnings,int);
89  vtkGetMacro(NegativeNormWarnings,int);
90  vtkBooleanMacro(NegativeNormWarnings,int);
91 
92  protected:
95 
96  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
97 
98  void EvaluateForce(double point[3], double force[3], bool normalize);
99  double EvaluatePotential(double point[3]);
100 
101  static bool IsInExtent(vtkIdType extent[6], int ijk[3], vtkIdType border)
102  {
103  return (ijk[0]>=extent[0]+border && ijk[0]<=extent[1]-border) && (ijk[1]>=extent[2]+border && ijk[1]<=extent[3]-border) && (ijk[2]>=extent[4]+border && ijk[2]<=extent[5]-border) ? true : false;
104  }
105 
106  static bool IsCellInExtent(int extent[6], int ijk[3], vtkIdType border)
107  {
108  return (ijk[0]>=extent[0]+border && ijk[0]<extent[1]-border) && (ijk[1]>=extent[2]+border && ijk[1]<extent[3]-border) && (ijk[2]>=extent[4]+border && ijk[2]<extent[5]-border) ? true : false;
109  }
110 
111  void EvolveCellSpline(vtkPolyData* lines, vtkIdType cellId);
112 
114 
115  vtkImageData *PotentialImage;
116  vtkImageData *PotentialGradientImage;
117 
120 
122  double Convergence;
123 
126 
128 
130 
133 
135 
137 
138 private:
139  vtkvmtkActiveTubeFilter(const vtkvmtkActiveTubeFilter&); // Not implemented.
140  void operator=(const vtkvmtkActiveTubeFilter&); // Not implemented.
141 };
142 
143 #endif
Experimental method for generating centerlines from an image.
static bool IsCellInExtent(int extent[6], int ijk[3], vtkIdType border)
static bool IsInExtent(vtkIdType extent[6], int ijk[3], vtkIdType border)