18 #ifndef __itkDeformableMesh3DFilter_h
19 #define __itkDeformableMesh3DFilter_h
20 #if !defined( ITK_LEGACY_REMOVE )
23 #include "vnl/vnl_matrix_fixed.h"
24 #include "vnl/vnl_math.h"
58 template<
typename TInputMesh,
typename TOutputMesh >
59 class DeformableMesh3DFilter:
public MeshToMeshFilter< TInputMesh, TOutputMesh >
63 typedef DeformableMesh3DFilter Self;
66 typedef MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass;
76 itkTypeMacro(DeformableMesh3DFilter, MeshToMeshFilter);
79 typedef TInputMesh InputMeshType;
80 typedef typename InputMeshType::PointsContainerPointer InputPointsContainerPointer;
81 typedef typename InputMeshType::PointsContainerConstPointer InputPointsContainerConstPointer;
82 typedef typename InputMeshType::PointsContainer::Iterator InputPointsContainerIterator;
83 typedef typename InputMeshType::PointsContainer::ConstIterator InputPointsContainerConstIterator;
84 typedef typename InputMeshType::PointDataContainerPointer InputPointDataContainerPointer;
85 typedef typename InputMeshType::PointDataContainer::Iterator InputPointDataContainerIterator;
86 typedef typename InputMeshType::CellsContainerPointer InputCellsContainerPointer;
87 typedef typename InputMeshType::CellsContainer::Iterator InputCellsContainerIterator;
88 typedef typename InputMeshType::CellsContainerConstPointer InputCellsContainerConstPointer;
89 typedef typename InputMeshType::CellsContainer::ConstIterator InputCellsContainerConstIterator;
90 typedef typename InputMeshType::CellDataContainerPointer InputCellDataContainerPointer;
91 typedef typename InputMeshType::CellDataContainer::Iterator InputCellDataContainerIterator;
92 typedef typename InputMeshType::CellDataContainerConstPointer InputCellDataContainerConstPointer;
93 typedef typename InputMeshType::CellDataContainer::ConstIterator InputCellDataContainerConstIterator;
95 typedef TOutputMesh OutputMeshType;
96 typedef typename OutputMeshType::PointsContainerPointer OutputPointsContainerPointer;
97 typedef typename OutputMeshType::CellsContainer OutputCellsContainer;
98 typedef typename OutputMeshType::CellsContainerPointer OutputCellsContainerPointer;
99 typedef typename OutputMeshType::PointsContainer::Iterator OutputPointsContainerIterator;
102 typedef typename InputMeshType::CellType CellType;
103 typedef typename InputMeshType::CellTraits CellTraits;
104 typedef typename InputMeshType::PointType InputPointType;
105 typedef typename InputMeshType::PixelType PixelType;
108 typedef Image< unsigned char, 3 > PotentialImageType;
109 typedef ImageRegionIterator< PotentialImageType > PotentialIterator;
110 typedef CovariantVector< PixelType, 3 > GradientType;
111 typedef Image< GradientType, 3 > GradientImageType;
112 typedef ImageRegionIterator< GradientImageType > GradientIterator;
113 typedef typename GradientImageType::SizeType ImageSizeType;
114 typedef typename GradientImageType::IndexType ImageIndexType;
119 typedef CovariantVector< int, 3 > int3DVector;
120 typedef CovariantVector< double, 2 > double2DVector;
124 typedef typename InputMeshType::Pointer InputMeshPointer;
125 typedef typename InputMeshType::ConstPointer InputMeshConstPointer;
126 typedef typename OutputMeshType::Pointer OutputMeshPointer;
127 typedef typename GradientImageType::Pointer GradientImagePointer;
130 typedef vnl_matrix_fixed< double, 4, 4 > StiffnessMatrixType;
131 typedef StiffnessMatrixType * StiffnessMatrixRawPointer;
134 void SetStiffnessMatrix(StiffnessMatrixType *stiff,
int i);
137 itkSetMacro(Gradient, GradientImagePointer);
138 itkGetConstMacro(Gradient, GradientImagePointer);
141 itkSetMacro(StepThreshold,
int);
142 itkGetConstMacro(StepThreshold,
int);
144 itkSetMacro(Stiffness, double2DVector);
145 itkGetConstMacro(Stiffness, double2DVector);
147 itkSetMacro(TimeStep,
double);
148 itkGetConstMacro(TimeStep,
double);
150 itkSetMacro(Scale, double3DVector);
152 itkSetMacro(PotentialMagnitude, PixelType);
153 itkSetMacro(GradientMagnitude, PixelType);
154 itkSetMacro(PotentialOn,
unsigned short);
155 itkSetMacro(ObjectLabel,
unsigned char);
157 itkGetConstMacro(Normals, InputMeshPointer);
160 DeformableMesh3DFilter();
161 ~DeformableMesh3DFilter();
162 DeformableMesh3DFilter(
const Self &);
163 void operator=(
const Self &);
164 void PrintSelf(std::ostream & os, Indent indent)
const;
166 virtual void GenerateData();
170 InputMeshPointer m_Forces;
171 InputMeshPointer m_Normals;
172 InputMeshPointer m_Displacements;
173 InputMeshPointer m_Derives;
174 InputMeshPointer m_Locations;
178 void SetDefaultStiffnessMatrix();
180 void SetMeshStiffness();
186 void ComputeOutput();
190 void ComputeNormals();
195 StiffnessMatrixType m_StiffnessMatrix[10];
196 StiffnessMatrixRawPointer *m_K;
199 double2DVector m_Stiffness;
202 double3DVector m_Scale;
215 unsigned short m_ModelXUpLimit;
216 unsigned short m_ModelXDownLimit;
217 unsigned short m_ModelYUpLimit;
218 unsigned short m_ModelYDownLimit;
219 unsigned short m_ModelZUpLimit;
220 unsigned short m_ModelZDownLimit;
221 unsigned short m_PotentialOn;
222 unsigned char m_ObjectLabel;
223 PixelType m_GradientMagnitude;
224 PixelType m_PotentialMagnitude;
227 GradientImagePointer m_Gradient;
228 PotentialImageType::Pointer m_Potential;
232 #ifndef ITK_MANUAL_INSTANTIATION
233 #include "itkDeformableMesh3DFilter.hxx"
236 #endif //#if !defined( ITK_LEGACY_REMOVE )
An abstract interface for cells.