ITK  5.4.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  * https://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 
96  itkOverrideGetNameOfClassMacro(DeformableSimplexMesh3DFilter);
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. */
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;
142  using GeometryMapIterator = typename GeometryMapType::Iterator;
143 
144 
146  void
147  SetGradient(const GradientImageType * gradientImage);
148  const GradientImageType *
149  GetGradient() const;
153  itkSetMacro(Iterations, int);
154  itkGetConstMacro(Iterations, int);
158  itkSetMacro(Alpha, double);
159  itkGetConstMacro(Alpha, double);
163  itkSetMacro(Beta, double);
164  itkGetConstMacro(Beta, double);
168  itkSetMacro(Gamma, double);
169  itkGetConstMacro(Gamma, double);
173  itkSetMacro(Damping, double);
174  itkGetConstMacro(Damping, double);
178  itkSetMacro(Rigidity, unsigned int);
179  itkGetConstMacro(Rigidity, unsigned int);
182  itkSetObjectMacro(Data, GeometryMapType);
183  itkGetModifiableObjectMacro(Data, GeometryMapType);
184 
186  itkGetConstMacro(ImageWidth, int);
187  itkGetConstMacro(ImageHeight, int);
188  itkGetConstMacro(ImageDepth, int);
192  itkGetConstMacro(Step, int);
193 
194 protected:
196  ~DeformableSimplexMesh3DFilter() override = default;
197  void
198  PrintSelf(std::ostream & os, Indent indent) const override;
199 
201  void
202  GenerateData() override;
203 
209  virtual void
210  Initialize();
211 
217  virtual void
218  ComputeGeometry();
219 
225  virtual void
226  ComputeDisplacement();
227 
231  virtual void
232  ComputeInternalForce(SimplexMeshGeometry * data);
233 
239  virtual void
240  ComputeExternalForce(SimplexMeshGeometry * data, const GradientImageType * gradientImage);
241 
246  virtual void
247  ComputeOutput();
248 
252  virtual void
253  UpdateReferenceMetrics();
254 
258  bool
259  L_Func(const double r, const double d, const double phi, double & output);
260 
264  PointType
265  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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
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::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::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 simplex mesh
Definition: itkSimplexMeshGeometry.h:44
itk::IndexValueType
long IndexValueType
Definition: itkIntTypes.h:90
itk::MapContainer
A wrapper of the STL "map" container.
Definition: itkMapContainer.h:45
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:55
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::MeshToMeshFilter
MeshToMeshFilter is the base class for all process objects that output mesh data, and require mesh da...
Definition: itkMeshToMeshFilter.h:47
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:108
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itkArray.h
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::DeformableSimplexMesh3DFilter::InputPointsContainer
typename InputMeshType::PointsContainer InputPointsContainer
Definition: itkDeformableSimplexMesh3DFilter.h:103
itkBinaryThresholdImageFilter.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
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