18 #ifndef itkDeformableMesh3DFilter_h
19 #define itkDeformableMesh3DFilter_h
20 #if !defined( ITK_LEGACY_REMOVE )
23 #include "vnl/vnl_matrix_fixed.h"
58 template<
typename TInputMesh,
typename TOutputMesh >
59 class ITK_TEMPLATE_EXPORT 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;
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;
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 ITK_DISALLOW_COPY_AND_ASSIGN(DeformableMesh3DFilter);
163 void PrintSelf(std::ostream & os, Indent indent)
const ITK_OVERRIDE;
165 virtual void GenerateData() ITK_OVERRIDE;
169 InputMeshPointer m_Forces;
170 InputMeshPointer m_Normals;
171 InputMeshPointer m_Displacements;
172 InputMeshPointer m_Derives;
173 InputMeshPointer m_Locations;
177 void SetDefaultStiffnessMatrix();
179 void SetMeshStiffness();
185 void ComputeOutput();
189 void ComputeNormals();
194 StiffnessMatrixType m_StiffnessMatrix[10];
195 StiffnessMatrixRawPointer *m_K;
198 double2DVector m_Stiffness;
201 double3DVector m_Scale;
214 unsigned short m_ModelXUpLimit;
215 unsigned short m_ModelXDownLimit;
216 unsigned short m_ModelYUpLimit;
217 unsigned short m_ModelYDownLimit;
218 unsigned short m_ModelZUpLimit;
219 unsigned short m_ModelZDownLimit;
220 unsigned short m_PotentialOn;
221 unsigned char m_ObjectLabel;
222 PixelType m_GradientMagnitude;
223 PixelType m_PotentialMagnitude;
226 GradientImagePointer m_Gradient;
227 PotentialImageType::Pointer m_Potential;
231 #ifndef ITK_MANUAL_INSTANTIATION
232 #include "itkDeformableMesh3DFilter.hxx"
235 #endif //#if !defined( ITK_LEGACY_REMOVE )
An abstract interface for cells.
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType