ITK  5.1.0
Insight 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
151  SetGradient(const GradientImageType * gradientImage);
152 
156  const GradientImageType *
157  GetGradient() const;
158 
162  itkSetMacro(Iterations, int);
163  itkGetConstMacro(Iterations, int);
165 
167  itkSetMacro(Alpha, double);
168 
170  itkGetConstMacro(Alpha, double);
171 
173  itkSetMacro(Beta, double);
174 
176  itkGetConstMacro(Beta, double);
177 
179  itkSetMacro(Gamma, double);
180 
182  itkGetConstMacro(Gamma, double);
183 
185  itkSetMacro(Damping, double);
186 
188  itkGetConstMacro(Damping, double);
189 
191  itkSetMacro(Rigidity, unsigned int);
192 
194  itkGetConstMacro(Rigidity, unsigned int);
195 
196  itkSetObjectMacro(Data, GeometryMapType);
197  itkGetModifiableObjectMacro(Data, GeometryMapType);
198 
200  itkGetConstMacro(ImageWidth, int);
201  itkGetConstMacro(ImageHeight, int);
202  itkGetConstMacro(ImageDepth, int);
204 
206  itkGetConstMacro(Step, int);
207 
208 protected:
210  ~DeformableSimplexMesh3DFilter() override = default;
211  void
212  PrintSelf(std::ostream & os, Indent indent) const override;
213 
215  void
216  GenerateData() override;
217 
223  virtual void
224  Initialize();
225 
231  virtual void
232  ComputeGeometry();
233 
239  virtual void
240  ComputeDisplacement();
241 
245  virtual void
246  ComputeInternalForce(SimplexMeshGeometry * data);
247 
252  virtual void
253  ComputeExternalForce(SimplexMeshGeometry * data, const GradientImageType * gradient);
254 
259  virtual void
260  ComputeOutput();
261 
265  virtual void
266  UpdateReferenceMetrics();
267 
271  bool
272  L_Func(const double r, const double d, const double phi, double & output);
273 
277  PointType
278  ComputeBarycentricCoordinates(PointType p, SimplexMeshGeometry * data);
279 
287  double m_Alpha;
288 
295  double m_Beta;
296 
303  double m_Gamma;
304  double m_Damping;
305 
312  unsigned int m_Rigidity;
313 
314  // definition of internal parameters
316  int m_Step;
317 
320 
323 
326 
329 
334 
335 }; // end of class
336 } // end namespace itk
337 
338 #ifndef ITK_MANUAL_INSTANTIATION
339 # include "itkDeformableSimplexMesh3DFilter.hxx"
340 #endif
341 
342 #endif // itkDeformableSimplexMesh3DFilter_h
itk::DeformableSimplexMesh3DFilter::IndexSetType
std::set< IdentifierType > IndexSetType
Definition: itkDeformableSimplexMesh3DFilter.h:134
itk::DeformableSimplexMesh3DFilter::GradientIndexValueType
typename GradientIndexType::IndexValueType GradientIndexValueType
Definition: itkDeformableSimplexMesh3DFilter.h:120
itk::DeformableSimplexMesh3DFilter::GradientImageSizeType
typename GradientImageType::SizeType GradientImageSizeType
Definition: itkDeformableSimplexMesh3DFilter.h:121
itkFloodFilledSpatialFunctionConditionalIterator.h
itk::DeformableSimplexMesh3DFilter::m_Iterations
int m_Iterations
Definition: itkDeformableSimplexMesh3DFilter.h:328
itk::DeformableSimplexMesh3DFilter::CellsContainerIterator
typename InputMeshType::CellsContainer::Iterator CellsContainerIterator
Definition: itkDeformableSimplexMesh3DFilter.h:129
itk::DeformableSimplexMesh3DFilter::PointType
typename SimplexMeshGeometry::PointType PointType
Definition: itkDeformableSimplexMesh3DFilter.h:106
itk::SimplexMeshGeometry::PointType
itk::Point< double, 3 > PointType
Definition: itkSimplexMeshGeometry.h:47
itkVectorGradientMagnitudeImageFilter.h
itk::DeformableSimplexMesh3DFilter::MeshPointType
typename InputMeshType::PointType MeshPointType
Definition: itkDeformableSimplexMesh3DFilter.h:127
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::DeformableSimplexMesh3DFilter::m_ImageWidth
int m_ImageWidth
Definition: itkDeformableSimplexMesh3DFilter.h:319
itk::DeformableSimplexMesh3DFilter::m_Alpha
double m_Alpha
Definition: itkDeformableSimplexMesh3DFilter.h:287
itk::MeshToMeshFilter::InputMeshPointer
typename InputMeshType::Pointer InputMeshPointer
Definition: itkMeshToMeshFilter.h:66
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::DeformableSimplexMesh3DFilter::NeighborSetType
std::set< IdentifierType > NeighborSetType
Definition: itkDeformableSimplexMesh3DFilter.h:133
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::DeformableSimplexMesh3DFilter::VectorType
typename PointType::VectorType VectorType
Definition: itkDeformableSimplexMesh3DFilter.h:107
itk::SmartPointer< Self >
itk::DeformableSimplexMesh3DFilter::GeometryMapIterator
typename GeometryMapType::Iterator GeometryMapIterator
Definition: itkDeformableSimplexMesh3DFilter.h:141
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DeformableSimplexMesh3DFilter::InputPointsContainerConstIterator
typename InputMeshType::PointsContainer::ConstIterator InputPointsContainerConstIterator
Definition: itkDeformableSimplexMesh3DFilter.h:103
itk::DeformableSimplexMesh3DFilter::GradientImagePointer
typename GradientImageType::Pointer GradientImagePointer
Definition: itkDeformableSimplexMesh3DFilter.h:117
itk::DeformableSimplexMesh3DFilter::GeometryMapPointer
typename GeometryMapType::Pointer GeometryMapPointer
Definition: itkDeformableSimplexMesh3DFilter.h:140
itk::DeformableSimplexMesh3DFilter::NeighborSetIterator
typename NeighborSetType::iterator NeighborSetIterator
Definition: itkDeformableSimplexMesh3DFilter.h:136
itk::DeformableSimplexMesh3DFilter::CellsContainerPointer
typename InputMeshType::CellsContainerPointer CellsContainerPointer
Definition: itkDeformableSimplexMesh3DFilter.h:128
itk::MeshToMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkMeshToMeshFilter.h:65
itk::SimplexMeshGeometry
handle geometric properties for vertices of a simplx mesh
Definition: itkSimplexMeshGeometry.h:44
itk::DeformableSimplexMesh3DFilter::m_Gamma
double m_Gamma
Definition: itkDeformableSimplexMesh3DFilter.h:303
itk::MapContainer
A wrapper of the STL "map" container.
Definition: itkMapContainer.h:45
itk::DeformableSimplexMesh3DFilter::m_Rigidity
unsigned int m_Rigidity
Definition: itkDeformableSimplexMesh3DFilter.h:312
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::DeformableSimplexMesh3DFilter::m_Step
int m_Step
Definition: itkDeformableSimplexMesh3DFilter.h:316
itk::DeformableSimplexMesh3DFilter::InputNeighbors
typename InputMeshType::NeighborListType InputNeighbors
Definition: itkDeformableSimplexMesh3DFilter.h:130
itk::DeformableSimplexMesh3DFilter::IndexSetIterator
typename IndexSetType::iterator IndexSetIterator
Definition: itkDeformableSimplexMesh3DFilter.h:137
itkSphereSpatialFunction.h
itk::DeformableSimplexMesh3DFilter::m_ImageDepth
int m_ImageDepth
Definition: itkDeformableSimplexMesh3DFilter.h:325
itk::MeshToMeshFilter
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
Definition: itkMeshToMeshFilter.h:47
itk::DeformableSimplexMesh3DFilter::m_Damping
double m_Damping
Definition: itkDeformableSimplexMesh3DFilter.h:304
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:106
itk::DeformableSimplexMesh3DFilter::m_ImageHeight
int m_ImageHeight
Definition: itkDeformableSimplexMesh3DFilter.h:322
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:68
itkArray.h
itk::DeformableSimplexMesh3DFilter::m_Data
GeometryMapPointer m_Data
Definition: itkDeformableSimplexMesh3DFilter.h:333
itkMeshToMeshFilter.h
itk::DeformableSimplexMesh3DFilter
Three-dimensional deformable model for image segmentation.
Definition: itkDeformableSimplexMesh3DFilter.h:76
itk::DeformableSimplexMesh3DFilter::InputPointsContainerPointer
typename InputMeshType::PointsContainerPointer InputPointsContainerPointer
Definition: itkDeformableSimplexMesh3DFilter.h:101
itk::DeformableSimplexMesh3DFilter::GradientIndexType
typename GradientImageType::IndexType GradientIndexType
Definition: itkDeformableSimplexMesh3DFilter.h:118
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkArray.h:26
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itk::DeformableSimplexMesh3DFilter::InputPointsContainer
typename InputMeshType::PointsContainer InputPointsContainer
Definition: itkDeformableSimplexMesh3DFilter.h:102
itkBinaryThresholdImageFilter.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::DeformableSimplexMesh3DFilter::InputNeighborsIterator
typename InputMeshType::NeighborListType::iterator InputNeighborsIterator
Definition: itkDeformableSimplexMesh3DFilter.h:131
itkSimplexMesh.h
itk::DeformableSimplexMesh3DFilter::PixelType
typename InputMeshType::PixelType PixelType
Definition: itkDeformableSimplexMesh3DFilter.h:109
itk::DeformableSimplexMesh3DFilter::GradientPixelType
typename GradientImageType::PixelType GradientPixelType
Definition: itkDeformableSimplexMesh3DFilter.h:119
itk::DeformableSimplexMesh3DFilter::GeometryMapType
typename InputMeshType::GeometryMapType GeometryMapType
Definition: itkDeformableSimplexMesh3DFilter.h:139
itk::DeformableSimplexMesh3DFilter::m_Beta
double m_Beta
Definition: itkDeformableSimplexMesh3DFilter.h:295