ITK  4.2.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 {
38 template< class TInputMesh, class TOutputMesh, class TSolverTraits >
40  public QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
41 {
42 public:
43 
46  typedef QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh,
47  TOutputMesh > Superclass;
50 
52  typedef TInputMesh InputMeshType;
53  typedef typename InputMeshType::Pointer InputMeshPointer;
54  typedef typename InputMeshType::ConstPointer InputMeshConstPointer;
55  typedef typename InputMeshType::CoordRepType InputCoordRepType;
56  typedef typename InputMeshType::PointType InputPointType;
57  typedef typename InputPointType::VectorType InputPointVectorType;
58  typedef typename InputMeshType::PointIdentifier InputPointIdentifier;
59  typedef typename InputMeshType::QEType InputQEType;
60  typedef typename InputMeshType::VectorType InputVectorType;
61  typedef typename InputMeshType::EdgeListType InputEdgeListType;
62  typedef typename InputMeshType::PixelType InputPixelType;
63  typedef typename InputMeshType::Traits InputTraits;
64 
65  itkStaticConstMacro(InputVDimension, unsigned int, InputMeshType::PointDimension);
66 
67  typedef typename InputMeshType::PointsContainer InputPointsContainer;
68  typedef typename InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator;
69 
70  typedef typename InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator;
71  typedef typename InputMeshType::EdgeCellType InputEdgeCellType;
72  typedef typename InputMeshType::PolygonCellType InputPolygonCellType;
73  typedef typename InputMeshType::PointIdList InputPointIdList;
74 
75  typedef typename InputQEType::IteratorGeom InputQEIterator;
76 
77  typedef std::map< InputPointIdentifier, InputPointIdentifier > InputMapPointIdentifier;
78  typedef typename InputMapPointIdentifier::iterator InputMapPoinIdentifierIterator;
79 
81  typedef TOutputMesh OutputMeshType;
82  typedef typename OutputMeshType::Pointer OutputMeshPointer;
83  typedef typename OutputMeshType::ConstPointer OutputMeshConstPointer;
84  typedef typename OutputMeshType::CoordRepType OutputCoordRepType;
85  typedef typename OutputMeshType::PointType OutputPointType;
86  typedef typename OutputMeshType::PointIdentifier OutputPointIdentifier;
87  typedef typename OutputMeshType::QEType OutputQEType;
88  typedef typename OutputMeshType::VectorType OutputVectorType;
89  typedef typename OutputQEType::IteratorGeom OutputQEIterator;
90  typedef typename OutputMeshType::PointsContainerIterator OutputPointsContainerIterator;
91 
92  itkStaticConstMacro(OutputVDimension, unsigned int, OutputMeshType::PointDimension);
93 
94  typedef TSolverTraits SolverTraits;
95  typedef typename SolverTraits::ValueType ValueType;
96  typedef typename SolverTraits::MatrixType MatrixType;
97  typedef typename SolverTraits::VectorType VectorType;
98 
101 
103 
104 public:
105 
106  void SetCoefficientsMethod(CoefficientsComputation *iMethod)
107  {
108  this->m_CoefficientsMethod = iMethod;
109  }
110 
111  itkNewMacro(Self);
113 
114  itkSetObjectMacro(BorderTransform, MeshBorderTransform);
115  itkGetObjectMacro(BorderTransform, MeshBorderTransform);
116 
117 protected:
118 
121  void PrintSelf(std::ostream & os, Indent indent) const;
122 
124 
126 
127  // first is the id of the input mesh and second is the corresponding id
128  // in m_BoundaryPtMap
130 
131  // first is the id of the input mesh and second is the corresponding id
132  // in m_InternalPtList
134 
135  std::vector< OutputPointType > m_Border;
136 
137  void CopyToOutputBorder();
138 
148  void ComputeListOfInteriorVertices();
149 
157  void FillMatrix(MatrixType & iM, VectorType & ioBx, VectorType & ioBy);
158 
169  void SolveLinearSystems(const MatrixType & iM,
170  const VectorType & iBx,
171  const VectorType & iBy,
172  VectorType & oX,
173  VectorType & oY);
174 
175  void GenerateData();
176 
177 private:
178 
179  ParameterizationQuadEdgeMeshFilter(const Self &); // purposely not implemented
180  void operator=(const Self &); // purposely not implemented
181 };
182 } // end namespace itk
183 
184 #include "itkParameterizationQuadEdgeMeshFilter.hxx"
185 
186 #endif
187