ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkParameterizationQuadEdgeMeshFilter.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 #ifndef itkParameterizationQuadEdgeMeshFilter_h
19 #define itkParameterizationQuadEdgeMeshFilter_h
20 
23 
24 namespace itk {
25 
55 template< typename TInputMesh, typename TOutputMesh, typename TSolverTraits >
57  public QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
58 {
59 public:
62  typedef QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh,
63  TOutputMesh > Superclass;
66 
68  typedef TInputMesh InputMeshType;
69  typedef typename InputMeshType::Pointer InputMeshPointer;
70  typedef typename InputMeshType::ConstPointer InputMeshConstPointer;
71  typedef typename InputMeshType::CoordRepType InputCoordRepType;
72  typedef typename InputMeshType::PointType InputPointType;
73  typedef typename InputPointType::VectorType InputPointVectorType;
74  typedef typename InputMeshType::PointIdentifier InputPointIdentifier;
75  typedef typename InputMeshType::QEType InputQEType;
76  typedef typename InputMeshType::VectorType InputVectorType;
77  typedef typename InputMeshType::EdgeListType InputEdgeListType;
78  typedef typename InputMeshType::PixelType InputPixelType;
79  typedef typename InputMeshType::Traits InputTraits;
80 
81  itkStaticConstMacro(InputVDimension, unsigned int, InputMeshType::PointDimension);
82 
83  typedef typename InputMeshType::PointsContainer InputPointsContainer;
84  typedef typename InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator;
85 
86  typedef typename InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator;
87  typedef typename InputMeshType::EdgeCellType InputEdgeCellType;
88  typedef typename InputMeshType::PolygonCellType InputPolygonCellType;
89  typedef typename InputMeshType::PointIdList InputPointIdList;
90 
91  typedef typename InputQEType::IteratorGeom InputQEIterator;
92 
93  typedef std::map< InputPointIdentifier, InputPointIdentifier > InputMapPointIdentifier;
94  typedef typename InputMapPointIdentifier::iterator InputMapPointIdentifierIterator;
95 
97  typedef TOutputMesh OutputMeshType;
98  typedef typename OutputMeshType::Pointer OutputMeshPointer;
99  typedef typename OutputMeshType::ConstPointer OutputMeshConstPointer;
100  typedef typename OutputMeshType::CoordRepType OutputCoordRepType;
101  typedef typename OutputMeshType::PointType OutputPointType;
102  typedef typename OutputMeshType::PointIdentifier OutputPointIdentifier;
103  typedef typename OutputMeshType::QEType OutputQEType;
104  typedef typename OutputMeshType::VectorType OutputVectorType;
105  typedef typename OutputQEType::IteratorGeom OutputQEIterator;
106  typedef typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator;
107 
108  itkStaticConstMacro(OutputVDimension, unsigned int, OutputMeshType::PointDimension);
109 
110  typedef TSolverTraits SolverTraits;
111  typedef typename SolverTraits::ValueType ValueType;
112  typedef typename SolverTraits::MatrixType MatrixType;
113  typedef typename SolverTraits::VectorType VectorType;
114 
117 
119 
120 public:
121 
123  {
124  this->m_CoefficientsMethod = iMethod;
125  }
126 
127  itkNewMacro(Self);
129 
130  itkSetObjectMacro(BorderTransform, MeshBorderTransform);
131  itkGetModifiableObjectMacro(BorderTransform, MeshBorderTransform);
132 
133 protected:
134 
137  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
138 
140 
142 
143  // first is the id of the input mesh and second is the corresponding id
144  // in m_BoundaryPtMap
146 
147  // first is the id of the input mesh and second is the corresponding id
148  // in m_InternalPtList
150 
151  std::vector< OutputPointType > m_Border;
152 
153  void CopyToOutputBorder();
154 
165 
173  void FillMatrix(MatrixType & iM, VectorType & ioBx, VectorType & ioBy);
174 
185  void SolveLinearSystems(const MatrixType & iM,
186  const VectorType & iBx,
187  const VectorType & iBy,
188  VectorType & oX,
189  VectorType & oY);
190 
191  void GenerateData() ITK_OVERRIDE;
192 
193 private:
194 
195  ParameterizationQuadEdgeMeshFilter(const Self &); // purposely not implemented
196  void operator=(const Self &); // purposely not implemented
197 };
198 } // end namespace itk
199 
200 #include "itkParameterizationQuadEdgeMeshFilter.hxx"
201 
202 #endif
BorderQuadEdgeMeshFilter< InputMeshType, InputMeshType > MeshBorderTransform
Light weight base class for most itk classes.
InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator
InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator
QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh > Superclass
void FillMatrix(MatrixType &iM, VectorType &ioBx, VectorType &ioBy)
Fill matrix iM and vectors Bx and m_By depending on if one vertex is on the border or not...
void SolveLinearSystems(const MatrixType &iM, const VectorType &iBx, const VectorType &iBy, VectorType &oX, VectorType &oY)
Solve linears systems : and .
void PrintSelf(std::ostream &os, Indent indent) const override
Transform one border of a QuadEdgeMesh into either a circle (conformal) or a square (arclength-wise)...
OutputMeshType::PointsContainerIterator OutputPointsContainerIterator
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void ComputeListOfInteriorVertices()
From the list of all vertices from the input mesh InputList and the list of boundary vertices Boundar...
InputMapPointIdentifier::iterator InputMapPointIdentifierIterator
std::map< InputPointIdentifier, InputPointIdentifier > InputMapPointIdentifier
Compute a planar parameterization of the input mesh.
void SetCoefficientsMethod(CoefficientsComputation *iMethod)
Superclass for all the matrix coefficients computation classes.