ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLaplacianDeformationQuadEdgeMeshFilter.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#ifndef itkLaplacianDeformationQuadEdgeMeshFilter_h
19#define itkLaplacianDeformationQuadEdgeMeshFilter_h
20
23#include "ITKQuadEdgeMeshFilteringExport.h"
24
25#include "itkConceptChecking.h"
26
27#include <unordered_map>
28
29namespace itk
30{
36{
37public:
41 enum class Area : uint8_t
42 {
44 NONE = 0,
45
48 };
49};
50// Define how to print enumeration
51extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream &
53
115template <class TInputMesh, class TOutputMesh, class TSolverTraits>
117 : public QuadEdgeMeshToQuadEdgeMeshFilter<TInputMesh, TOutputMesh>
118{
119public:
120 ITK_DISALLOW_COPY_AND_MOVE(LaplacianDeformationQuadEdgeMeshFilter);
121
127
128 itkOverrideGetNameOfClassMacro(LaplacianDeformationQuadEdgeMeshFilter);
129
131 using InputMeshType = TInputMesh;
132 using typename Superclass::InputPointType;
133
134 static constexpr unsigned int InputPointDimension = InputMeshType::PointDimension;
135
137 using OutputMeshType = TOutputMesh;
139 using typename Superclass::OutputPointType;
141 using typename Superclass::OutputQEPrimal;
142 using typename Superclass::OutputVectorType;
143 using typename Superclass::OutputQEIterator;
144
145 static constexpr unsigned int OutputPointDimension = OutputMeshType::PointDimension;
146
147 using SolverTraits = TSolverTraits;
148 using ValueType = typename SolverTraits::ValueType;
149 using MatrixType = typename SolverTraits::MatrixType;
150 using VectorType = typename SolverTraits::VectorType;
151
153
155 void
157 {
158 this->m_CoefficientsMethod = iMethod;
159 this->Modified();
160 }
161
162
164
166 void
168
170 void
172
176 bool
178
180 void
182
184 itkSetMacro(Order, unsigned int);
185 itkGetMacro(Order, unsigned int);
187
189#if !defined(ITK_LEGACY_REMOVE)
191 static constexpr AreaEnum NONE = AreaEnum::NONE;
192 static constexpr AreaEnum MIXEDAREA = AreaEnum::MIXEDAREA;
193#endif
194
196 itkSetEnumMacro(AreaComputationType, AreaEnum);
197 itkGetMacro(AreaComputationType, AreaEnum);
199
202
203protected:
208
209 using OutputMapPointIdentifier = std::unordered_map<OutputPointIdentifier, OutputPointIdentifier>;
210 using OutputMapPointIdentifierIterator = typename OutputMapPointIdentifier::iterator;
211 using OutputMapPointIdentifierConstIterator = typename OutputMapPointIdentifier::const_iterator;
212
213 using ConstraintMapType = std::unordered_map<OutputPointIdentifier, OutputVectorType>;
214 using ConstraintMapConstIterator = typename ConstraintMapType::const_iterator;
215
217 {
218 size_t
220 {
221 return reinterpret_cast<size_t>(qe);
222 }
223 };
224
225 using CoefficientMapType = std::unordered_map<OutputQEPrimal *, OutputCoordinateType, HashOutputQEPrimal>;
226 using CoefficientMapConstIterator = typename CoefficientMapType::const_iterator;
227
228 using AreaMapType = std::unordered_map<OutputPointIdentifier, OutputCoordinateType>;
229 using AreaMapConstIterator = typename AreaMapType::const_iterator;
230
231 using RowType = std::unordered_map<OutputPointIdentifier, OutputCoordinateType>;
232 using RowIterator = typename RowType::iterator;
233 using RowConstIterator = typename RowType::const_iterator;
234
239
241
242 unsigned int m_Order{ 1 };
244
245 void
246 PrintSelf(std::ostream & os, Indent indent) const override;
247
252
253 virtual void
255
256 void
258
259 void
260 FillMatrixRow(OutputPointIdentifier iId, unsigned int iDegree, OutputCoordinateType iWeight, RowType & ioRow);
261
266 void
268
281 void
283 const VectorType & iBx,
284 const VectorType & iBy,
285 const VectorType & iBz,
286 VectorType & oX,
287 VectorType & oY,
288 VectorType & oZ);
289
290
291private:
292 struct Triple
293 {
294 Triple() = default;
295 Triple(OutputPointIdentifier iV, OutputCoordinateType iWeight, unsigned int iDegree)
296 : m_Id(iV)
297 , m_Weight(iWeight)
298 , m_Degree(iDegree)
299 {}
300
303 unsigned int m_Degree;
304 };
305};
306} // end namespace itk
307
308#include "itkLaplacianDeformationQuadEdgeMeshFilter.hxx"
309
310#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
Contains all enum classes used by LaplacianDeformationQuadEdgeMeshFilter class.
void SetConstrainedNode(OutputPointIdentifier vId, const OutputPointType &iP)
bool GetDisplacement(OutputPointIdentifier vId, OutputVectorType &oV) const
void FillMatrixRow(OutputPointIdentifier iId, unsigned int iDegree, OutputCoordinateType iWeight, RowType &ioRow)
std::unordered_map< OutputPointIdentifier, OutputPointIdentifier > OutputMapPointIdentifier
typename CoefficientMapType::const_iterator CoefficientMapConstIterator
void FillMatrix(MatrixType &iM, VectorType &iBx, VectorType &iBy, VectorType &iBz)
Fill matrix iM and vectors Bx, m_By and m_Bz depending on if one vertex is on the border or not.
typename ConstraintMapType::const_iterator ConstraintMapConstIterator
typename OutputMeshType::PointIdentifier OutputPointIdentifier
OutputCoordinateType ComputeMixedArea(OutputQEPrimal *iQE1, OutputQEPrimal *iQE2)
std::unordered_map< OutputPointIdentifier, OutputCoordinateType > RowType
typename OutputMapPointIdentifier::const_iterator OutputMapPointIdentifierConstIterator
LaplacianDeformationQuadEdgeMeshFilterEnums::Area AreaEnum
typename OutputMeshType::CoordinateType OutputCoordinateType
OutputCoordinateType ComputeMixedAreaForGivenVertex(OutputPointIdentifier iId)
QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
std::unordered_map< OutputPointIdentifier, OutputVectorType > ConstraintMapType
std::unordered_map< OutputPointIdentifier, OutputCoordinateType > AreaMapType
void SolveLinearSystems(const MatrixType &iM, const VectorType &iBx, const VectorType &iBy, const VectorType &iBz, VectorType &oX, VectorType &oY, VectorType &oZ)
Solve linear systems : and and .
typename OutputMapPointIdentifier::iterator OutputMapPointIdentifierIterator
~LaplacianDeformationQuadEdgeMeshFilter() override=default
std::unordered_map< OutputQEPrimal *, OutputCoordinateType, HashOutputQEPrimal > CoefficientMapType
void SetDisplacement(OutputPointIdentifier vId, const OutputVectorType &iV)
Superclass for all the matrix coefficients computation classes.
virtual void Modified() const
typename OutputQEPrimal::IteratorGeom OutputQEIterator
typename OutputMeshType::PointIdentifier OutputPointIdentifier
typename OutputMeshType::CoordinateType OutputCoordinateType
Implements transparent reference counting.
A convenience class for computation of various triangle elements in 2D or 3D.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
Triple(OutputPointIdentifier iV, OutputCoordinateType iWeight, unsigned int iDegree)