18 #ifndef itkBalloonForceFilter_h
19 #define itkBalloonForceFilter_h
20 #if !defined( ITK_LEGACY_REMOVE )
23 #include "vnl/vnl_matrix_fixed.h"
57 template<
typename TInputMesh,
typename TOutputMesh >
58 class ITK_TEMPLATE_EXPORT BalloonForceFilter:
public MeshToMeshFilter< TInputMesh, TOutputMesh >
62 typedef BalloonForceFilter Self;
63 typedef MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass;
71 itkTypeMacro(BalloonForceFilter, MeshToMeshFilter);
74 typedef TInputMesh InputMeshType;
75 typedef TOutputMesh OutputMeshType;
78 typedef typename InputMeshType::PointsContainerPointer
79 InputPointsContainerPointer;
80 typedef typename InputMeshType::PointsContainer::Iterator
81 InputPointsContainerIterator;
82 typedef typename InputMeshType::PointsContainerConstPointer
83 InputPointsContainerConstPointer;
84 typedef typename InputMeshType::PointsContainer::ConstIterator
85 InputPointsContainerConstIterator;
86 typedef typename InputMeshType::PointDataContainerPointer
87 InputPointDataContainerPointer;
88 typedef typename InputMeshType::PointDataContainer::Iterator
89 InputPointDataContainerIterator;
90 typedef typename InputMeshType::CellsContainerPointer
91 InputCellsContainerPointer;
92 typedef typename InputMeshType::CellsContainer::Iterator
93 InputCellsContainerIterator;
94 typedef typename InputMeshType::CellDataContainerPointer
95 InputCellDataContainerPointer;
96 typedef typename InputMeshType::CellDataContainer::Iterator
97 InputCellDataContainerIterator;
98 typedef typename InputMeshType::CellsContainerConstPointer
99 InputCellsContainerConstPointer;
100 typedef typename InputMeshType::CellsContainer::ConstIterator
101 InputCellsContainerConstIterator;
102 typedef typename InputMeshType::CellDataContainerConstPointer
103 InputCellDataContainerConstPointer;
104 typedef typename InputMeshType::CellDataContainer::ConstIterator
105 InputCellDataContainerConstIterator;
107 typedef typename OutputMeshType::PointsContainerPointer
108 OutputPointsContainerPointer;
109 typedef typename OutputMeshType::PointsContainer::Iterator
110 OutputPointsContainerIterator;
114 typedef typename InputMeshType::PixelType PixelType;
116 typedef Image< unsigned short, 2 > ImageType;
117 typedef CovariantVector< PixelType, 2 > GradientType;
118 typedef Image< GradientType, 2 > GradientImageType;
119 typedef typename InputMeshType::Pointer InputMeshPointer;
120 typedef typename InputMeshType::ConstPointer InputMeshConstPointer;
121 typedef typename OutputMeshType::Pointer OutputMeshPointer;
122 typedef typename ImageType::Pointer ImagePointer;
124 typedef typename GradientImageType::Pointer GradientImagePointer;
126 typedef ImageRegionIterator< ImageType > ImageIterator;
127 typedef Vector< float, 3 > FloatVector;
128 typedef Vector< int, 3 > IntVector;
129 typedef Vector< double, 2 > Double2Vector;
130 typedef Vector< int, 2 > Int2Vector;
133 typedef typename InputMeshType::CellType CellType;
134 typedef typename InputMeshType::CellTraits CellTraits;
135 typedef::itk::CellInterface< PixelType, CellTraits >
CellInterface;
136 typedef::itk::TriangleCell< CellInterface > TriCell;
143 void SetStiffnessMatrix();
151 void ComputeOutput();
153 void NodeAddition(
int i,
int res, IPixelType z);
157 void NodesRearrange();
163 void ComputeNormals();
168 itkSetMacro(ImageOutput, ImagePointer);
169 itkGetConstMacro(ImageOutput, ImagePointer);
170 itkSetMacro(Gradient, GradientImagePointer);
174 itkSetMacro(Stiffness, Double2Vector);
175 itkSetMacro(TimeStep,
double);
176 itkSetMacro(GradientBegin,
int);
177 itkSetMacro(Resolution,
int);
179 itkGetConstMacro(Normals, InputMeshPointer);
180 itkSetMacro(DistanceForGradient,
float);
181 itkSetMacro(DistanceToStop,
float);
182 itkSetMacro(Potential, ImagePointer);
183 itkGetConstMacro(Locations, InputMeshPointer);
184 itkGetConstMacro(Displacements, InputMeshPointer);
185 itkGetConstMacro(Derives, InputMeshPointer);
186 itkGetConstMacro(Forces, InputMeshPointer);
190 BalloonForceFilter();
191 ~BalloonForceFilter();
192 void PrintSelf(std::ostream & os, Indent indent)
const ITK_OVERRIDE;
194 virtual void GenerateData() ITK_OVERRIDE;
197 ITK_DISALLOW_COPY_AND_ASSIGN(BalloonForceFilter);
200 InputMeshPointer m_Forces;
201 InputMeshPointer m_Normals;
202 InputMeshPointer m_Displacements;
203 InputMeshPointer m_Derives;
204 InputMeshPointer m_Locations;
205 InputMeshPointer m_Input;
206 OutputMeshPointer m_Output;
209 vnl_matrix_fixed<
double, 4, 4 > m_NStiffness;
210 vnl_matrix_fixed<
double, 4, 4 > m_SStiffness;
211 vnl_matrix_fixed<
double, 4, 4 > m_CStiffness;
212 vnl_matrix_fixed<
double, 4, 4 > **m_K;
214 Double2Vector m_Stiffness;
222 unsigned int m_NumberOfNodes;
223 unsigned int m_NumberOfCells;
224 unsigned int m_NumNewNodes;
226 int * m_GapLocations;
228 int m_NewNodesExisted;
229 unsigned int m_NewNodeLimit;
230 unsigned int m_ImageWidth;
231 unsigned int m_ImageHeight;
232 unsigned int m_ImageDepth;
236 int m_ModelXDownLimit;
238 int m_ModelYDownLimit;
243 Int2Vector m_StepThreshold;
247 float m_DistanceToBoundary;
248 float m_DistanceToStop;
249 float m_DistanceForGradient;
251 ImagePointer m_Potential;
253 GradientImagePointer m_Gradient;
257 ImagePointer m_ImageOutput;
258 unsigned short m_ObjectLabel;
260 typedef ImageType::
SizeType ImageSizeType;
264 #ifndef ITK_MANUAL_INSTANTIATION
265 #include "itkBalloonForceFilter.hxx"
268 #endif //#if !defined( ITK_LEGACY_REMOVE )
class ITK_TEMPLATE_EXPORT CellInterface
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType