ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkDeformableSimplexMesh3DFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef itkDeformableSimplexMesh3DFilter_h
29 #define itkDeformableSimplexMesh3DFilter_h
30 
31 #include "itkMeshToMeshFilter.h"
32 #include "itkSimplexMesh.h"
37 #include "itkArray.h"
38 
39 #include <set>
40 
41 namespace itk
42 {
75 template< typename TInputMesh, typename TOutputMesh >
76 class ITK_TEMPLATE_EXPORT DeformableSimplexMesh3DFilter:public MeshToMeshFilter< TInputMesh, TOutputMesh >
77 {
78 public:
81 
84 
88 
90  itkNewMacro(Self);
91 
94 
96  typedef TInputMesh InputMeshType;
97  typedef TOutputMesh OutputMeshType;
98 
99  typedef typename InputMeshType::PointsContainerPointer InputPointsContainerPointer;
100  typedef typename InputMeshType::PointsContainer InputPointsContainer;
101  typedef typename InputMeshType::PointsContainer::ConstIterator InputPointsContainerConstIterator;
102 
107  typedef typename InputMeshType::PixelType PixelType;
108 
114 
120 
121  /* Mesh pointer definition. */
122  typedef typename InputMeshType::Pointer InputMeshPointer;
123  typedef typename OutputMeshType::Pointer OutputMeshPointer;
124 
126  typedef typename InputMeshType::CellsContainerPointer CellsContainerPointer;
127  typedef typename InputMeshType::CellsContainer::Iterator CellsContainerIterator;
128  typedef typename InputMeshType::NeighborListType InputNeighbors;
129  typedef typename InputMeshType::NeighborListType::iterator InputNeighborsIterator;
130 
131  typedef std::set< IdentifierType > NeighborSetType;
132  typedef std::set< IdentifierType > IndexSetType;
134  typedef typename NeighborSetType::iterator NeighborSetIterator;
135  typedef typename IndexSetType::iterator IndexSetIterator;
136 
137  typedef typename InputMeshType::GeometryMapType GeometryMapType;
138  typedef typename GeometryMapType::Pointer GeometryMapPointer;
139  typedef typename GeometryMapType::Iterator GeometryMapIterator;
140 
148  void SetGradient( const GradientImageType * gradientImage );
149 
153  const GradientImageType * GetGradient() const;
154 
158  itkSetMacro(Iterations, int);
159  itkGetConstMacro(Iterations, int);
161 
163  itkSetMacro(Alpha, double);
164 
166  itkGetConstMacro(Alpha, double);
167 
169  itkSetMacro(Beta, double);
170 
172  itkGetConstMacro(Beta, double);
173 
175  itkSetMacro(Gamma, double);
176 
178  itkGetConstMacro(Gamma, double);
179 
181  itkSetMacro(Damping, double);
182 
184  itkGetConstMacro(Damping, double);
185 
187  itkSetMacro(Rigidity, unsigned int);
188 
190  itkGetConstMacro(Rigidity, unsigned int);
191 
192  itkSetObjectMacro(Data, GeometryMapType);
193  itkGetModifiableObjectMacro(Data, GeometryMapType);
194 
196  itkGetConstMacro(ImageWidth, int);
197  itkGetConstMacro(ImageHeight, int);
198  itkGetConstMacro(ImageDepth, int);
200 
202  itkGetConstMacro(Step, int);
203 
204 protected:
206  ~DeformableSimplexMesh3DFilter() ITK_OVERRIDE;
207  ITK_DISALLOW_COPY_AND_ASSIGN(DeformableSimplexMesh3DFilter);
208 
209  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
210 
212  virtual void GenerateData() ITK_OVERRIDE;
213 
219  virtual void Initialize();
220 
226  virtual void ComputeGeometry();
227 
233  virtual void ComputeDisplacement();
234 
238  virtual void ComputeInternalForce(SimplexMeshGeometry *data);
239 
244  virtual void ComputeExternalForce(SimplexMeshGeometry *data, const GradientImageType *gradient);
245 
250  virtual void ComputeOutput();
251 
255  virtual void UpdateReferenceMetrics();
256 
260  bool L_Func(const double r, const double d, const double phi, double & output);
261 
265  PointType ComputeBarycentricCoordinates(PointType p, SimplexMeshGeometry *data);
266 
274  double m_Alpha;
275 
282  double m_Beta;
283 
290  double m_Gamma;
291  double m_Damping;
292 
299  unsigned int m_Rigidity;
300 
301  // definition of internal parameters
303  int m_Step;
304 
306  int m_ImageWidth;
307 
309  int m_ImageHeight;
310 
312  int m_ImageDepth;
313 
315  int m_Iterations;
316 
321 
322 }; // end of class
323 } // end namespace itk
324 
325 #ifndef ITK_MANUAL_INSTANTIATION
326 #include "itkDeformableSimplexMesh3DFilter.hxx"
327 #endif
328 
329 #endif //itkDeformableSimplexMesh3DFilter_h
InputMeshType::CellsContainer::Iterator CellsContainerIterator
MeshToMeshFilter< TInputMesh, TOutputMesh > Superclass
Light weight base class for most itk classes.
Three-dimensional deformable model for image segmentation.
InputMeshType::PointsContainer::ConstIterator InputPointsContainerConstIterator
A wrapper of the STL &quot;map&quot; container.
InputMeshType::CellsContainerPointer CellsContainerPointer
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
CovariantVector< typename VectorType::ValueType, 3 > CovariantVectorType
InputMeshType::PointsContainer InputPointsContainer
TPixel PixelType
Definition: itkImage.h:89
InputMeshType::NeighborListType::iterator InputNeighborsIterator
::itk::IndexValueType IndexValueType
Definition: itkIndex.h:80
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
Superclass::SizeType SizeType
Definition: itkImage.h:126
GradientIndexType::IndexValueType GradientIndexValueType
handle geometric properties for vertices of a simplx mesh
Control indentation during Print() invocation.
Definition: itkIndent.h:49
InputMeshType::PointsContainerPointer InputPointsContainerPointer
itk::MapContainer< IdentifierType, NeighborSetType > VertexNeighborListType
A templated class holding a n-Dimensional covariant vector.
Templated n-dimensional image class.
Definition: itkImage.h:75