ITK  6.0.0
Insight Toolkit
itkFastMarchingQuadEdgeMeshFilterBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 {
44 template <typename TInput, typename TOutput>
45 class ITK_TEMPLATE_EXPORT FastMarchingQuadEdgeMeshFilterBase : public FastMarchingBase<TInput, TOutput>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(FastMarchingQuadEdgeMeshFilterBase);
49 
54  using typename Superclass::Traits;
55 
57  itkNewMacro(Self);
58 
60  itkOverrideGetNameOfClassMacro(FastMarchingQuadEdgeMeshFilterBase);
61 
62  using InputMeshType = typename Superclass::InputDomainType;
63  using InputMeshPointer = typename Superclass::InputDomainPointer;
64  using typename Superclass::InputPixelType;
66  using InputPointIdentifierType = typename InputMeshType::PointIdentifier;
67 
68  using OutputMeshType = typename Superclass::OutputDomainType;
69  using OutputMeshPointer = typename Superclass::OutputDomainPointer;
70  using 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;
78  using OutputPointsContainerIterator = typename OutputPointsContainer::Iterator;
79  using OutputPointDataContainer = typename OutputMeshType::PointDataContainer;
81 
82  using OutputCellsContainer = typename OutputMeshType::CellsContainer;
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 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:
106  ~FastMarchingQuadEdgeMeshFilterBase() override = default;
107 
108  NodeLabelMapType m_Label{};
109 
111  GetTotalNumberOfNodes() const override;
112 
113  void
114  SetOutputValue(OutputMeshType * oMesh, const NodeType & iNode, const OutputPixelType & iValue) override;
115 
116  const OutputPixelType
117  GetOutputValue(OutputMeshType * oMesh, const NodeType & iNode) const override;
118 
119  unsigned char
120  GetLabelValueForGivenNode(const NodeType & iNode) const override;
121 
122  void
123  SetLabelValueForGivenNode(const NodeType & iNode, const LabelType & iLabel) override;
124 
125  void
126  UpdateNeighbors(OutputMeshType * oMesh, const NodeType & iNode) override;
127 
128  void
129  UpdateValue(OutputMeshType * oMesh, const NodeType & iNode) override;
130 
131  const OutputVectorRealType
132  Solve(OutputMeshType * oMesh,
133  const NodeType & iId,
134  const OutputPointType & iCurrentPoint,
135  const OutputVectorRealType & iF,
136  const NodeType & iId1,
137  const OutputPointType & iP1,
138  const bool iIsFar1,
139  const OutputVectorRealType iVal1,
140  const NodeType & iId2,
141  const OutputPointType & iP2,
142  const bool iIsFar2,
143  const OutputVectorRealType & iVal2) const;
144 
145 
146  const OutputVectorRealType
147  ComputeUpdate(const OutputVectorRealType & iVal1,
148  const OutputVectorRealType & iVal2,
149  const OutputVectorRealType & iNorm1,
150  const OutputVectorRealType & iSqNorm1,
151  const OutputVectorRealType & iNorm2,
152  const OutputVectorRealType & iSqNorm2,
153  const OutputVectorRealType & iDot,
154  const OutputVectorRealType & iF) const;
155 
156  bool
157  UnfoldTriangle(OutputMeshType * oMesh,
158  const OutputPointIdentifierType & iId,
159  const OutputPointType & iP,
160  const OutputPointIdentifierType & iId1,
161  const OutputPointType & iP1,
162  const OutputPointIdentifierType & iId2,
163  const OutputPointType & iP2,
164  OutputVectorRealType & oNorm,
165  OutputVectorRealType & oSqNorm,
166  OutputVectorRealType & oDot1,
167  OutputVectorRealType & oDot2,
168  OutputPointIdentifierType & oId) const;
169 
170  bool
171  CheckTopology(OutputMeshType * oMesh, const NodeType & iNode) override;
172 
173  void
174  InitializeOutput(OutputMeshType * oMesh) override;
175 
176 private:
177  const InputMeshType * m_InputMesh{};
178 };
179 } // namespace itk
180 
181 #ifndef ITK_MANUAL_INSTANTIATION
182 # include "itkFastMarchingQuadEdgeMeshFilterBase.hxx"
183 #endif
184 
185 #endif // itkFastMarchingQuadEdgeMeshFilterBase_h
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::FastMarchingQuadEdgeMeshFilterBase::OutputPointsContainer
typename OutputMeshType::PointsContainer OutputPointsContainer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:76
itk::FastMarchingQuadEdgeMeshFilterBase::NodeLabelMapType
std::map< NodeType, LabelType > NodeLabelMapType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:100
itk::FastMarchingBase::NodePairContainerPointer
typename Traits::NodePairContainerPointer NodePairContainerPointer
Definition: itkFastMarchingBase.h:158
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::FastMarchingQuadEdgeMeshFilterBase::OutputCellType
typename OutputMeshType::CellType OutputCellType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:85
itk::FastMarchingQuadEdgeMeshFilterBase::OutputCellsContainer
typename OutputMeshType::CellsContainer OutputCellsContainer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:82
itk::FastMarchingQuadEdgeMeshFilterBase::OutputMeshPointer
typename Superclass::OutputDomainPointer OutputMeshPointer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:69
itk::FastMarchingBase::NodePairType
typename Traits::NodePairType NodePairType
Definition: itkFastMarchingBase.h:156
itk::SmartPointer< Self >
itkFastMarchingTraits.h
itk::FastMarchingQuadEdgeMeshFilterBase::InputPointType
typename InputMeshType::PointType InputPointType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:65
itkFastMarchingBase.h
itk::FastMarchingQuadEdgeMeshFilterBase::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:71
itk::FastMarchingQuadEdgeMeshFilterBase::NodeLabelMapIterator
typename NodeLabelMapType::iterator NodeLabelMapIterator
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:101
itk::FastMarchingQuadEdgeMeshFilterBase::OutputCellsContainerPointer
typename OutputCellsContainer::Pointer OutputCellsContainerPointer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:83
itk::FastMarchingQuadEdgeMeshFilterBase::InputPointIdentifierType
typename InputMeshType::PointIdentifier InputPointIdentifierType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:66
itk::FastMarchingQuadEdgeMeshFilterBase::OutputQEType
typename OutputMeshType::QEType OutputQEType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:74
itk::FastMarchingQuadEdgeMeshFilterBase::OutputPointsContainerPointer
typename OutputPointsContainer::Pointer OutputPointsContainerPointer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:77
itk::FastMarchingQuadEdgeMeshFilterBase::OutputVectorType
typename OutputPointType::VectorType OutputVectorType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:72
itk::FastMarchingBase::NodePairContainerType
typename Traits::NodePairContainerType NodePairContainerType
Definition: itkFastMarchingBase.h:157
itk::FastMarchingBase::Superclass
typename FastMarchingTraits< TInput, TOutput >::SuperclassType Superclass
Definition: itkFastMarchingBase.h:135
itk::FastMarchingQuadEdgeMeshFilterBase::OutputPointDataContainerPointer
typename OutputPointDataContainer::Pointer OutputPointDataContainerPointer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:80
itk::FastMarchingBase::NodePairContainerConstIterator
typename Traits::NodePairContainerConstIterator NodePairContainerConstIterator
Definition: itkFastMarchingBase.h:159
itk::FastMarchingQuadEdgeMeshFilterBase::OutputPointIdentifierType
typename OutputMeshType::PointIdentifier OutputPointIdentifierType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:75
itk::FastMarchingQuadEdgeMeshFilterBase::InputMeshPointer
typename Superclass::InputDomainPointer InputMeshPointer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:63
itk::FastMarchingBase::NodeType
typename Traits::NodeType NodeType
Definition: itkFastMarchingBase.h:153
itk::FastMarchingQuadEdgeMeshFilterBase::InputMeshType
typename Superclass::InputDomainType InputMeshType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:62
itk::FastMarchingQuadEdgeMeshFilterBase::NodeLabelMapConstIterator
typename NodeLabelMapType::const_iterator NodeLabelMapConstIterator
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:102
itk::FastMarchingQuadEdgeMeshFilterBase::OutputVectorRealType
typename OutputVectorType::RealValueType OutputVectorRealType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:73
itk::FastMarchingQuadEdgeMeshFilterBase
Fast Marching Method on QuadEdgeMesh.
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:45
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::FastMarchingQuadEdgeMeshFilterBase::OutputPointDataContainer
typename OutputMeshType::PointDataContainer OutputPointDataContainer
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:79
itk::FastMarchingQuadEdgeMeshFilterBase::OutputMeshType
typename Superclass::OutputDomainType OutputMeshType
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:68
itk::FastMarchingQuadEdgeMeshFilterBase::OutputPointsContainerIterator
typename OutputPointsContainer::Iterator OutputPointsContainerIterator
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:78
itk::FastMarchingQuadEdgeMeshFilterBase::OutputCellsContainerConstIterator
typename OutputCellsContainer::ConstIterator OutputCellsContainerConstIterator
Definition: itkFastMarchingQuadEdgeMeshFilterBase.h:84
itk::FastMarchingBase
Abstract class to solve an Eikonal based-equation using Fast Marching Method.
Definition: itkFastMarchingBase.h:126
itk::IdentifierType
SizeValueType IdentifierType
Definition: itkIntTypes.h:90