ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkFastMarchingQuadEdgeMeshFilterBase.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 
19 #ifndef __itkFastMarchingQuadEdgeMeshFilterBase_h
20 #define __itkFastMarchingQuadEdgeMeshFilterBase_h
21 
22 #include "itkFastMarchingBase.h"
23 #include "itkFastMarchingTraits.h"
24 
25 namespace itk
26 {
43 template< class TInput, class TOutput >
45  public FastMarchingBase< TInput, TOutput >
46 {
47 public:
52  typedef typename Superclass::Traits Traits;
53 
55  itkNewMacro(Self);
56 
59 
63  typedef typename InputMeshType::PointType InputPointType;
64  typedef typename InputMeshType::PointIdentifier InputPointIdentifierType;
65 
69  typedef typename OutputMeshType::PointType OutputPointType;
70  typedef typename OutputPointType::VectorType OutputVectorType;
71  typedef typename OutputVectorType::RealValueType OutputVectorRealType;
72  typedef typename OutputMeshType::QEType OutputQEType;
73  typedef typename OutputMeshType::PointIdentifier OutputPointIdentifierType;
74  typedef typename OutputMeshType::PointsContainer OutputPointsContainer;
75  typedef typename OutputPointsContainer::Pointer OutputPointsContainerPointer;
76  typedef typename OutputPointsContainer::Iterator OutputPointsContainerIterator;
77  typedef typename OutputMeshType::PointDataContainer
79  typedef typename OutputPointDataContainer::Pointer
81 
82  typedef typename OutputMeshType::CellsContainer OutputCellsContainer;
83  typedef typename OutputCellsContainer::Pointer OutputCellsContainerPointer;
84  typedef typename OutputCellsContainer::ConstIterator
86  typedef typename OutputMeshType::CellType OutputCellType;
87 
88 
89  typedef typename Traits::NodeType NodeType;
90  typedef typename Traits::NodePairType NodePairType;
91  typedef typename Traits::NodePairContainerType NodePairContainerType;
92  typedef typename Traits::NodePairContainerPointer NodePairContainerPointer;
93  typedef typename Traits::NodePairContainerConstIterator
95 
96 // typedef typename Traits::NodeContainerType NodeContainerType;
97 // typedef typename Traits::NodeContainerPointer NodeContainerPointer;
98 // typedef typename Traits::NodeContainerConstIterator
99 // NodeContainerConstIterator;
100 
102 
103  typedef std::map< NodeType, LabelType > NodeLabelMapType;
104  typedef typename NodeLabelMapType::iterator NodeLabelMapIterator;
105  typedef typename NodeLabelMapType::const_iterator NodeLabelMapConstIterator;
106 
107 protected:
108 
111 
113 
115 
116  void SetOutputValue( OutputMeshType* oMesh,
117  const NodeType& iNode,
118  const OutputPixelType& iValue );
119 
121  const NodeType& iNode ) const;
122 
123  unsigned char GetLabelValueForGivenNode( const NodeType& iNode ) const;
124 
125  void SetLabelValueForGivenNode( const NodeType& iNode,
126  const LabelType& iLabel );
127 
128  void UpdateNeighbors( OutputMeshType* oMesh,
129  const NodeType& iNode );
130 
131  void UpdateValue( OutputMeshType* oMesh,
132  const NodeType& iNode );
133 
135  Solve( OutputMeshType* oMesh,
136  const NodeType& iId, const OutputPointType& iCurrentPoint,
137  const OutputVectorRealType& iF,
138  const NodeType& iId1, const OutputPointType& iP1,
139  const bool& iIsFar1, const OutputVectorRealType iVal1,
140  const NodeType& iId2, const OutputPointType& iP2,
141  const bool& iIsFar2, const OutputVectorRealType& iVal2 )
142  const;
143 
144 
147  const OutputVectorRealType& iVal1, const OutputVectorRealType& iVal2,
148  const OutputVectorRealType& iNorm1, const OutputVectorRealType& iSqNorm1,
149  const OutputVectorRealType& iNorm2, const OutputVectorRealType& iSqNorm2,
150  const OutputVectorRealType& iDot, const OutputVectorRealType& iF )
151  const;
152 
153  bool UnfoldTriangle(
154  OutputMeshType* oMesh,
155  const OutputPointIdentifierType& iId, const OutputPointType& iP,
156  const OutputPointIdentifierType& iId1, const OutputPointType& iP1,
157  const OutputPointIdentifierType& iId2, const OutputPointType &iP2,
160  OutputPointIdentifierType& oId ) const;
161 
162  bool CheckTopology( OutputMeshType* oMesh,
163  const NodeType& iNode );
164 
165  void InitializeOutput( OutputMeshType* oMesh );
166 
167 private:
169  void operator = ( const Self& );
171 };
172 }
173 
174 #include "itkFastMarchingQuadEdgeMeshFilterBase.hxx"
175 #endif // __itkFastMarchingQuadEdgeMeshFilterBase_h
176