ITK  5.2.0
Insight Toolkit
itkDeformableSimplexMesh3DFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
76 template <typename TInputMesh, typename TOutputMesh>
77 class ITK_TEMPLATE_EXPORT DeformableSimplexMesh3DFilter : public MeshToMeshFilter<TInputMesh, TOutputMesh>
78 {
79 public:
80  ITK_DISALLOW_COPY_AND_MOVE(DeformableSimplexMesh3DFilter);
81 
84 
87 
91 
93  itkNewMacro(Self);
94 
97 
99  using InputMeshType = TInputMesh;
100  using OutputMeshType = TOutputMesh;
101 
102  using InputPointsContainerPointer = typename InputMeshType::PointsContainerPointer;
103  using InputPointsContainer = typename InputMeshType::PointsContainer;
104  using InputPointsContainerConstIterator = typename InputMeshType::PointsContainer::ConstIterator;
105 
110  using PixelType = typename InputMeshType::PixelType;
111 
117 
123 
124  /* Mesh pointer definition. */
125  using InputMeshPointer = typename InputMeshType::Pointer;
126  using OutputMeshPointer = typename OutputMeshType::Pointer;
127 
129  using CellsContainerPointer = typename InputMeshType::CellsContainerPointer;
130  using CellsContainerIterator = typename InputMeshType::CellsContainer::Iterator;
131  using InputNeighbors = typename InputMeshType::NeighborListType;
132  using InputNeighborsIterator = typename InputMeshType::NeighborListType::iterator;
133 
134  using NeighborSetType = std::set<IdentifierType>;
135  using IndexSetType = std::set<IdentifierType>;
137  using NeighborSetIterator = typename NeighborSetType::iterator;
138  using IndexSetIterator = typename IndexSetType::iterator;
139 
140  using GeometryMapType = typename InputMeshType::GeometryMapType;
141  using GeometryMapPointer = typename GeometryMapType::Pointer;
142  using GeometryMapIterator = typename GeometryMapType::Iterator;
143 
151  void
152  SetGradient(const GradientImageType * gradientImage);
153 
157  const GradientImageType *
158  GetGradient() const;
159 
163  itkSetMacro(Iterations, int);
164  itkGetConstMacro(Iterations, int);
166 
168  itkSetMacro(Alpha, double);
169 
171  itkGetConstMacro(Alpha, double);
172 
174  itkSetMacro(Beta, double);
175 
177  itkGetConstMacro(Beta, double);
178 
180  itkSetMacro(Gamma, double);
181 
183  itkGetConstMacro(Gamma, double);
184 
186  itkSetMacro(Damping, double);
187 
189  itkGetConstMacro(Damping, double);
190 
192  itkSetMacro(Rigidity, unsigned int);
193 
195  itkGetConstMacro(Rigidity, unsigned int);
196 
197  itkSetObjectMacro(Data, GeometryMapType);
198  itkGetModifiableObjectMacro(Data, GeometryMapType);
199 
201  itkGetConstMacro(ImageWidth, int);
202  itkGetConstMacro(ImageHeight, int);
203  itkGetConstMacro(ImageDepth, int);
205 
207  itkGetConstMacro(Step, int);
208 
209 protected:
211  ~DeformableSimplexMesh3DFilter() override = default;
212  void
213  PrintSelf(std::ostream & os, Indent indent) const override;
214 
216  void
217  GenerateData() override;
218 
224  virtual void
225  Initialize();
226 
232  virtual void
233  ComputeGeometry();
234 
240  virtual void
241  ComputeDisplacement();
242 
246  virtual void
247  ComputeInternalForce(SimplexMeshGeometry * data);
248 
253  virtual void
254  ComputeExternalForce(SimplexMeshGeometry * data, const GradientImageType * gradientImage);
255 
260  virtual void
261  ComputeOutput();
262 
266  virtual void
267  UpdateReferenceMetrics();
268 
272  bool
273  L_Func(const double r, const double d, const double phi, double & output);
274 
278  PointType
279  ComputeBarycentricCoordinates(PointType p, SimplexMeshGeometry * data);
280 
288  double m_Alpha;
289 
296  double m_Beta;
297 
304  double m_Gamma;
305  double m_Damping;
306 
313  unsigned int m_Rigidity;
314 
315  // definition of internal parameters
317  int m_Step;
318 
321 
324 
327 
330 
335 
336 }; // end of class
337 } // end namespace itk
338 
339 #ifndef ITK_MANUAL_INSTANTIATION
340 # include "itkDeformableSimplexMesh3DFilter.hxx"
341 #endif
342 
343 #endif // itkDeformableSimplexMesh3DFilter_h
itk::DeformableSimplexMesh3DFilter::IndexSetType
std::set< IdentifierType > IndexSetType
Definition: itkDeformableSimplexMesh3DFilter.h:135
itk::DeformableSimplexMesh3DFilter::GradientIndexValueType
typename GradientIndexType::IndexValueType GradientIndexValueType
Definition: itkDeformableSimplexMesh3DFilter.h:121
itk::DeformableSimplexMesh3DFilter::GradientImageSizeType
typename GradientImageType::SizeType GradientImageSizeType
Definition: itkDeformableSimplexMesh3DFilter.h:122
itkFloodFilledSpatialFunctionConditionalIterator.h
itk::DeformableSimplexMesh3DFilter::m_Iterations
int m_Iterations
Definition: itkDeformableSimplexMesh3DFilter.h:329
itk::DeformableSimplexMesh3DFilter::CellsContainerIterator
typename InputMeshType::CellsContainer::Iterator CellsContainerIterator
Definition: itkDeformableSimplexMesh3DFilter.h:130
itk::DeformableSimplexMesh3DFilter::PointType
typename SimplexMeshGeometry::PointType PointType
Definition: itkDeformableSimplexMesh3DFilter.h:107
itk::SimplexMeshGeometry::PointType
itk::Point< double, 3 > PointType
Definition: itkSimplexMeshGeometry.h:47
itkVectorGradientMagnitudeImageFilter.h
itk::DeformableSimplexMesh3DFilter::MeshPointType
typename InputMeshType::PointType MeshPointType
Definition: itkDeformableSimplexMesh3DFilter.h:128
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::DeformableSimplexMesh3DFilter::m_ImageWidth
int m_ImageWidth
Definition: itkDeformableSimplexMesh3DFilter.h:320
itk::DeformableSimplexMesh3DFilter::m_Alpha
double m_Alpha
Definition: itkDeformableSimplexMesh3DFilter.h:288
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:134
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::DeformableSimplexMesh3DFilter::VectorType
typename PointType::VectorType VectorType
Definition: itkDeformableSimplexMesh3DFilter.h:108
itk::SmartPointer< Self >
itk::DeformableSimplexMesh3DFilter::GeometryMapIterator
typename GeometryMapType::Iterator GeometryMapIterator
Definition: itkDeformableSimplexMesh3DFilter.h:142
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DeformableSimplexMesh3DFilter::InputPointsContainerConstIterator
typename InputMeshType::PointsContainer::ConstIterator InputPointsContainerConstIterator
Definition: itkDeformableSimplexMesh3DFilter.h:104
itk::DeformableSimplexMesh3DFilter::GradientImagePointer
typename GradientImageType::Pointer GradientImagePointer
Definition: itkDeformableSimplexMesh3DFilter.h:118
itk::DeformableSimplexMesh3DFilter::GeometryMapPointer
typename GeometryMapType::Pointer GeometryMapPointer
Definition: itkDeformableSimplexMesh3DFilter.h:141
itk::DeformableSimplexMesh3DFilter::NeighborSetIterator
typename NeighborSetType::iterator NeighborSetIterator
Definition: itkDeformableSimplexMesh3DFilter.h:137
itk::DeformableSimplexMesh3DFilter::CellsContainerPointer
typename InputMeshType::CellsContainerPointer CellsContainerPointer
Definition: itkDeformableSimplexMesh3DFilter.h:129
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:304
itk::MapContainer
A wrapper of the STL "map" container.
Definition: itkMapContainer.h:45
itk::DeformableSimplexMesh3DFilter::m_Rigidity
unsigned int m_Rigidity
Definition: itkDeformableSimplexMesh3DFilter.h:313
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:317
itk::DeformableSimplexMesh3DFilter::InputNeighbors
typename InputMeshType::NeighborListType InputNeighbors
Definition: itkDeformableSimplexMesh3DFilter.h:131
itk::DeformableSimplexMesh3DFilter::IndexSetIterator
typename IndexSetType::iterator IndexSetIterator
Definition: itkDeformableSimplexMesh3DFilter.h:138
itkSphereSpatialFunction.h
itk::DeformableSimplexMesh3DFilter::m_ImageDepth
int m_ImageDepth
Definition: itkDeformableSimplexMesh3DFilter.h:326
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:305
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:106
itk::DeformableSimplexMesh3DFilter::m_ImageHeight
int m_ImageHeight
Definition: itkDeformableSimplexMesh3DFilter.h:323
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itkArray.h
itk::DeformableSimplexMesh3DFilter::m_Data
GeometryMapPointer m_Data
Definition: itkDeformableSimplexMesh3DFilter.h:334
itkMeshToMeshFilter.h
itk::DeformableSimplexMesh3DFilter
Three-dimensional deformable model for image segmentation.
Definition: itkDeformableSimplexMesh3DFilter.h:77
itk::DeformableSimplexMesh3DFilter::InputPointsContainerPointer
typename InputMeshType::PointsContainerPointer InputPointsContainerPointer
Definition: itkDeformableSimplexMesh3DFilter.h:102
itk::DeformableSimplexMesh3DFilter::GradientIndexType
typename GradientImageType::IndexType GradientIndexType
Definition: itkDeformableSimplexMesh3DFilter.h:119
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itk::DeformableSimplexMesh3DFilter::InputPointsContainer
typename InputMeshType::PointsContainer InputPointsContainer
Definition: itkDeformableSimplexMesh3DFilter.h:103
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:132
itkSimplexMesh.h
itk::DeformableSimplexMesh3DFilter::PixelType
typename InputMeshType::PixelType PixelType
Definition: itkDeformableSimplexMesh3DFilter.h:110
itk::DeformableSimplexMesh3DFilter::GradientPixelType
typename GradientImageType::PixelType GradientPixelType
Definition: itkDeformableSimplexMesh3DFilter.h:120
itk::DeformableSimplexMesh3DFilter::GeometryMapType
typename InputMeshType::GeometryMapType GeometryMapType
Definition: itkDeformableSimplexMesh3DFilter.h:140
itk::DeformableSimplexMesh3DFilter::m_Beta
double m_Beta
Definition: itkDeformableSimplexMesh3DFilter.h:296