ITK  4.13.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< typename TInput, typename TOutput >
44 class ITK_TEMPLATE_EXPORT FastMarchingQuadEdgeMeshFilterBase :
45  public FastMarchingBase< TInput, TOutput >
46 {
47 public:
52  typedef typename Superclass::Traits Traits;
53 
55  itkNewMacro(Self);
56 
59 
61  typedef typename Superclass::InputDomainPointer InputMeshPointer;
62  typedef typename Superclass::InputPixelType InputPixelType;
64  typedef typename InputMeshType::PointIdentifier InputPointIdentifierType;
65 
66  typedef typename Superclass::OutputDomainType OutputMeshType;
67  typedef typename Superclass::OutputDomainPointer OutputMeshPointer;
68  typedef typename Superclass::OutputPixelType OutputPixelType;
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 
110  virtual ~FastMarchingQuadEdgeMeshFilterBase() ITK_OVERRIDE;
111 
113 
114  IdentifierType GetTotalNumberOfNodes() const ITK_OVERRIDE;
115 
116  void SetOutputValue( OutputMeshType* oMesh,
117  const NodeType& iNode,
118  const OutputPixelType& iValue ) ITK_OVERRIDE;
119 
120  const OutputPixelType GetOutputValue( OutputMeshType* oMesh,
121  const NodeType& iNode ) const ITK_OVERRIDE;
122 
123  unsigned char GetLabelValueForGivenNode( const NodeType& iNode ) const ITK_OVERRIDE;
124 
125  void SetLabelValueForGivenNode( const NodeType& iNode,
126  const LabelType& iLabel ) ITK_OVERRIDE;
127 
128  void UpdateNeighbors( OutputMeshType* oMesh,
129  const NodeType& iNode ) ITK_OVERRIDE;
130 
131  void UpdateValue( OutputMeshType* oMesh,
132  const NodeType& iNode ) ITK_OVERRIDE;
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 
146  ComputeUpdate(
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 ) ITK_OVERRIDE;
164 
165  void InitializeOutput( OutputMeshType* oMesh ) ITK_OVERRIDE;
166 
167 private:
168  ITK_DISALLOW_COPY_AND_ASSIGN(FastMarchingQuadEdgeMeshFilterBase);
169 
170  const InputMeshType *m_InputMesh;
171 };
172 }
173 
174 #ifndef ITK_MANUAL_INSTANTIATION
175 #include "itkFastMarchingQuadEdgeMeshFilterBase.hxx"
176 #endif
177 
178 #endif // itkFastMarchingQuadEdgeMeshFilterBase_h
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
Abstract class to solve an Eikonal based-equation using Fast Marching Method.
Traits::InputDomainType InputDomainType
Traits::OutputPixelType OutputPixelType
OutputPointDataContainer::Pointer OutputPointDataContainerPointer
Traits::NodePairContainerConstIterator NodePairContainerConstIterator
Traits::LabelType LabelType
OutputCellsContainer::ConstIterator OutputCellsContainerConstIterator