ITK  5.0.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:
48  ITK_DISALLOW_COPY_AND_ASSIGN(FastMarchingQuadEdgeMeshFilterBase);
49 
54  using Traits = typename Superclass::Traits;
55 
57  itkNewMacro(Self);
58 
61 
62  using InputMeshType = typename Superclass::InputDomainType;
63  using InputMeshPointer = typename Superclass::InputDomainPointer;
64  using InputPixelType = typename Superclass::InputPixelType;
66  using InputPointIdentifierType = typename InputMeshType::PointIdentifier;
67 
68  using OutputMeshType = typename Superclass::OutputDomainType;
69  using OutputMeshPointer = typename Superclass::OutputDomainPointer;
70  using OutputPixelType = typename Superclass::OutputPixelType;
73  using OutputVectorRealType = typename OutputVectorType::RealValueType;
74  using OutputQEType = typename OutputMeshType::QEType;
75  using OutputPointIdentifierType = typename OutputMeshType::PointIdentifier;
76  using OutputPointsContainer = typename OutputMeshType::PointsContainer;
77  using OutputPointsContainerPointer = typename OutputPointsContainer::Pointer;
78  using OutputPointsContainerIterator = typename OutputPointsContainer::Iterator;
79  using OutputPointDataContainer = typename OutputMeshType::PointDataContainer;
80  using OutputPointDataContainerPointer = typename OutputPointDataContainer::Pointer;
81 
82  using OutputCellsContainer = typename OutputMeshType::CellsContainer;
83  using OutputCellsContainerPointer = typename OutputCellsContainer::Pointer;
84  using OutputCellsContainerConstIterator = typename OutputCellsContainer::ConstIterator;
85  using OutputCellType = typename OutputMeshType::CellType;
86 
87 
88  using NodeType = typename Traits::NodeType;
89  using NodePairType = typename Traits::NodePairType;
90  using NodePairContainerType = typename Traits::NodePairContainerType;
91  using NodePairContainerPointer = typename Traits::NodePairContainerPointer;
92  using NodePairContainerConstIterator = typename Traits::NodePairContainerConstIterator;
93 
94 // using NodeContainerType = typename Traits::NodeContainerType;
95 // using NodeContainerPointer = typename Traits::NodeContainerPointer;
96 // using NodeContainerConstIterator = typename Traits::NodeContainerConstIterator;
97 
98  using LabelType = typename Superclass::LabelType;
99 
100  using NodeLabelMapType = std::map< NodeType, LabelType >;
101  using NodeLabelMapIterator = typename NodeLabelMapType::iterator;
102  using NodeLabelMapConstIterator = typename NodeLabelMapType::const_iterator;
103 
104 protected:
105 
107  ~FastMarchingQuadEdgeMeshFilterBase() override = default;
108 
110 
111  IdentifierType GetTotalNumberOfNodes() const override;
112 
113  void SetOutputValue( OutputMeshType* oMesh,
114  const NodeType& iNode,
115  const OutputPixelType& iValue ) override;
116 
117  const OutputPixelType GetOutputValue( OutputMeshType* oMesh,
118  const NodeType& iNode ) const override;
119 
120  unsigned char GetLabelValueForGivenNode( const NodeType& iNode ) const override;
121 
122  void SetLabelValueForGivenNode( const NodeType& iNode,
123  const LabelType& iLabel ) override;
124 
125  void UpdateNeighbors( OutputMeshType* oMesh,
126  const NodeType& iNode ) override;
127 
128  void UpdateValue( OutputMeshType* oMesh,
129  const NodeType& iNode ) override;
130 
132  Solve( OutputMeshType* oMesh,
133  const NodeType& iId, const OutputPointType& iCurrentPoint,
134  const OutputVectorRealType& iF,
135  const NodeType& iId1, const OutputPointType& iP1,
136  const bool& iIsFar1, const OutputVectorRealType iVal1,
137  const NodeType& iId2, const OutputPointType& iP2,
138  const bool& iIsFar2, const OutputVectorRealType& iVal2 )
139  const;
140 
141 
143  ComputeUpdate(
144  const OutputVectorRealType& iVal1, const OutputVectorRealType& iVal2,
145  const OutputVectorRealType& iNorm1, const OutputVectorRealType& iSqNorm1,
146  const OutputVectorRealType& iNorm2, const OutputVectorRealType& iSqNorm2,
147  const OutputVectorRealType& iDot, const OutputVectorRealType& iF )
148  const;
149 
150  bool UnfoldTriangle(
151  OutputMeshType* oMesh,
152  const OutputPointIdentifierType& iId, const OutputPointType& iP,
153  const OutputPointIdentifierType& iId1, const OutputPointType& iP1,
154  const OutputPointIdentifierType& iId2, const OutputPointType &iP2,
157  OutputPointIdentifierType& oId ) const;
158 
159  bool CheckTopology( OutputMeshType* oMesh,
160  const NodeType& iNode ) override;
161 
162  void InitializeOutput( OutputMeshType* oMesh ) override;
163 
164 private:
166 };
167 }
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 #include "itkFastMarchingQuadEdgeMeshFilterBase.hxx"
171 #endif
172 
173 #endif // itkFastMarchingQuadEdgeMeshFilterBase_h
typename Superclass::InputDomainPointer InputMeshPointer
typename Traits::LabelType LabelType
typename Traits::NodeType NodeType
typename Traits::NodePairContainerConstIterator NodePairContainerConstIterator
typename OutputPointsContainer::Pointer OutputPointsContainerPointer
typename OutputCellsContainer::Pointer OutputCellsContainerPointer
typename Traits::OutputPixelType OutputPixelType
typename OutputCellsContainer::ConstIterator OutputCellsContainerConstIterator
typename Traits::NodePairType NodePairType
typename OutputPointDataContainer::Pointer OutputPointDataContainerPointer
typename OutputMeshType::PointIdentifier OutputPointIdentifierType
typename OutputMeshType::PointsContainer OutputPointsContainer
Abstract class to solve an Eikonal based-equation using Fast Marching Method.
typename NodeLabelMapType::const_iterator NodeLabelMapConstIterator
typename OutputVectorType::RealValueType OutputVectorRealType
typename FastMarchingTraits< TInput, TOutput >::SuperclassType Superclass
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
typename Traits::NodePairContainerType NodePairContainerType
typename Traits::InputPixelType InputPixelType
typename OutputMeshType::CellsContainer OutputCellsContainer
typename Superclass::OutputDomainPointer OutputMeshPointer
Base class traits to be used by the FastMarchingBase.
typename InputMeshType::PointIdentifier InputPointIdentifierType
typename OutputMeshType::PointDataContainer OutputPointDataContainer
typename Traits::NodePairContainerPointer NodePairContainerPointer
typename OutputPointsContainer::Iterator OutputPointsContainerIterator