ITK  5.0.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:
79  ITK_DISALLOW_COPY_AND_ASSIGN(DeformableSimplexMesh3DFilter);
80 
83 
86 
90 
92  itkNewMacro(Self);
93 
96 
98  using InputMeshType = TInputMesh;
99  using OutputMeshType = TOutputMesh;
100 
101  using InputPointsContainerPointer = typename InputMeshType::PointsContainerPointer;
102  using InputPointsContainer = typename InputMeshType::PointsContainer;
103  using InputPointsContainerConstIterator = typename InputMeshType::PointsContainer::ConstIterator;
104 
109  using PixelType = typename InputMeshType::PixelType;
110 
116 
122 
123  /* Mesh pointer definition. */
124  using InputMeshPointer = typename InputMeshType::Pointer;
125  using OutputMeshPointer = typename OutputMeshType::Pointer;
126 
128  using CellsContainerPointer = typename InputMeshType::CellsContainerPointer;
129  using CellsContainerIterator = typename InputMeshType::CellsContainer::Iterator;
130  using InputNeighbors = typename InputMeshType::NeighborListType;
131  using InputNeighborsIterator = typename InputMeshType::NeighborListType::iterator;
132 
133  using NeighborSetType = std::set< IdentifierType >;
134  using IndexSetType = std::set< IdentifierType >;
136  using NeighborSetIterator = typename NeighborSetType::iterator;
137  using IndexSetIterator = typename IndexSetType::iterator;
138 
139  using GeometryMapType = typename InputMeshType::GeometryMapType;
140  using GeometryMapPointer = typename GeometryMapType::Pointer;
141  using GeometryMapIterator = typename GeometryMapType::Iterator;
142 
150  void SetGradient( const GradientImageType * gradientImage );
151 
155  const GradientImageType * GetGradient() const;
156 
160  itkSetMacro(Iterations, int);
161  itkGetConstMacro(Iterations, int);
163 
165  itkSetMacro(Alpha, double);
166 
168  itkGetConstMacro(Alpha, double);
169 
171  itkSetMacro(Beta, double);
172 
174  itkGetConstMacro(Beta, double);
175 
177  itkSetMacro(Gamma, double);
178 
180  itkGetConstMacro(Gamma, double);
181 
183  itkSetMacro(Damping, double);
184 
186  itkGetConstMacro(Damping, double);
187 
189  itkSetMacro(Rigidity, unsigned int);
190 
192  itkGetConstMacro(Rigidity, unsigned int);
193 
194  itkSetObjectMacro(Data, GeometryMapType);
195  itkGetModifiableObjectMacro(Data, GeometryMapType);
196 
198  itkGetConstMacro(ImageWidth, int);
199  itkGetConstMacro(ImageHeight, int);
200  itkGetConstMacro(ImageDepth, int);
202 
204  itkGetConstMacro(Step, int);
205 
206 protected:
208  ~DeformableSimplexMesh3DFilter() override = default;
209  void PrintSelf(std::ostream & os, Indent indent) const override;
210 
212  void GenerateData() 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 
307 
310 
313 
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
TPixel PixelType
Definition: itkImage.h:95
typename GradientImageType::Pointer GradientImagePointer
Light weight base class for most itk classes.
Three-dimensional deformable model for image segmentation.
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
typename InputMeshType::PointType MeshPointType
typename GradientImageType::IndexType GradientIndexType
typename SimplexMeshGeometry::PointType PointType
typename InputMeshType::CellsContainer::Iterator CellsContainerIterator
A wrapper of the STL &quot;map&quot; container.
typename InputMeshType::PointsContainerPointer InputPointsContainerPointer
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
itk::Point< double, 3 > PointType
typename GeometryMapType::Pointer GeometryMapPointer
typename InputMeshType::Pointer InputMeshPointer
typename InputMeshType::PointsContainer InputPointsContainer
typename InputMeshType::GeometryMapType GeometryMapType
typename GeometryMapType::Iterator GeometryMapIterator
typename InputMeshType::NeighborListType InputNeighbors
typename InputMeshType::PointsContainer::ConstIterator InputPointsContainerConstIterator
signed long IndexValueType
Definition: itkIntTypes.h:90
typename GradientImageType::PixelType GradientPixelType
typename GradientIndexType::IndexValueType GradientIndexValueType
typename GradientImageType::SizeType GradientImageSizeType
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
typename InputMeshType::NeighborListType::iterator InputNeighborsIterator
typename IndexSetType::iterator IndexSetIterator
typename InputMeshType::CellsContainerPointer CellsContainerPointer
handle geometric properties for vertices of a simplx mesh
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename NeighborSetType::iterator NeighborSetIterator
A templated class holding a n-Dimensional covariant vector.
Templated n-dimensional image class.
Definition: itkImage.h:75