ITK  5.2.0
Insight Toolkit
itkBorderQuadEdgeMeshFilter.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  * 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 itkBorderQuadEdgeMeshFilter_h
19 #define itkBorderQuadEdgeMeshFilter_h
20 
21 #include "itkAutoPointer.h"
22 #include "itkQuadEdgeMesh.h"
25 #include "ITKQuadEdgeMeshFilteringExport.h"
26 
27 namespace itk
28 {
34 {
35 public:
39  enum class BorderTransform : uint8_t
40  {
43  };
44 
48  enum class BorderPick : uint8_t
49  {
50  LONGEST = 0,
51  LARGEST
52  };
53 };
54 // Define how to print enumeration
55 extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream &
56  operator<<(std::ostream & out, const BorderQuadEdgeMeshFilterEnums::BorderTransform value);
57 extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream &
58  operator<<(std::ostream & out, const BorderQuadEdgeMeshFilterEnums::BorderPick value);
81 template <typename TInputMesh, typename TOutputMesh = TInputMesh>
82 class ITK_TEMPLATE_EXPORT BorderQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdgeMeshFilter<TInputMesh, TOutputMesh>
83 {
84 public:
85  ITK_DISALLOW_COPY_AND_MOVE(BorderQuadEdgeMeshFilter);
87 
93 
94  using InputMeshType = TInputMesh;
95  using InputMeshConstPointer = typename InputMeshType::ConstPointer;
96  using InputCoordRepType = typename InputMeshType::CoordRepType;
98  using InputTraits = typename InputMeshType::Traits;
99  using InputPointIdentifier = typename InputMeshType::PointIdentifier;
100  using InputQEType = typename InputMeshType::QEType;
101  using InputIteratorGeom = typename InputQEType::IteratorGeom;
103  using InputEdgeListType = typename InputMeshType::EdgeListType;
105  using InputEdgeListIterator = typename InputEdgeListType::iterator;
106  using InputEdgeCellType = typename InputMeshType::EdgeCellType;
107  using InputPolygonCellType = typename InputMeshType::PolygonCellType;
108  using InputPointIdList = typename InputMeshType::PointIdList;
109  using InputPointsContainer = typename InputMeshType::PointsContainer;
110  using InputPointsContainerConstIterator = typename InputMeshType::PointsContainerConstIterator;
111  using InputCellsContainerConstIterator = typename InputMeshType::CellsContainerConstIterator;
112 
113  using OutputMeshType = TOutputMesh;
114  using OutputMeshPointer = typename OutputMeshType::Pointer;
115  using OutputCoordRepType = typename OutputMeshType::CoordRepType;
117  using OutputTraits = typename OutputMeshType::Traits;
118  using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
119  using OutputQEType = typename OutputMeshType::QEType;
121  using OutputEdgeListType = typename OutputMeshType::EdgeListType;
122  using OutputEdgeCellType = typename OutputMeshType::EdgeCellType;
123  using OutputPolygonCellType = typename OutputMeshType::PolygonCellType;
124  using OutputPointIdList = typename OutputMeshType::PointIdList;
125  using OutputPointsContainer = typename OutputMeshType::PointsContainer;
126  using OutputPointsContainerConstIterator = typename OutputMeshType::PointsContainerConstIterator;
127  using OutputCellsContainerConstIterator = typename OutputMeshType::CellsContainerConstIterator;
128 
129  itkNewMacro(Self);
131  static constexpr unsigned int PointDimension = InputTraits::PointDimension;
132 
133  using InputVectorPointType = std::vector<InputPointType>;
134  using MapPointIdentifier = std::map<InputPointIdentifier, OutputPointIdentifier>;
135  using MapPointIdentifierIterator = typename MapPointIdentifier::iterator;
136 
139 
142 #if !defined(ITK_LEGACY_REMOVE)
143 
144  static constexpr BorderTransformEnum SQUARE_BORDER_TRANSFORM = BorderTransformEnum::SQUARE_BORDER_TRANSFORM;
145  static constexpr BorderTransformEnum DISK_BORDER_TRANSFORM = BorderTransformEnum::DISK_BORDER_TRANSFORM;
146 
147  static constexpr BorderPickEnum LONGEST = BorderPickEnum::LONGEST;
148  static constexpr BorderPickEnum LARGEST = BorderPickEnum::LARGEST;
149 #endif
150 
151  itkSetEnumMacro(TransformType, BorderTransformEnum);
152  itkGetConstMacro(TransformType, BorderTransformEnum);
153 
154  itkSetEnumMacro(BorderPick, BorderPickEnum);
155  itkGetConstMacro(BorderPick, BorderPickEnum);
156 
157  itkSetMacro(Radius, InputCoordRepType);
158  itkGetConstMacro(Radius, InputCoordRepType);
159 
160  void
161  ComputeTransform();
162 
164  GetBoundaryPtMap();
165 
167  GetBorder();
168 
169 protected:
171 
172  ~BorderQuadEdgeMeshFilter() override = default;
173 
174  void
175  PrintSelf(std::ostream & os, Indent indent) const override;
176 
179 
181 
183 
185 
186  void
187  GenerateData() override;
188 
189  void
190  ComputeBoundary();
191 
192  InputQEType *
193  ComputeLongestBorder();
194 
195  InputQEType *
196  ComputeLargestBorder();
197 
198  void
199  DiskTransform();
200 
202  GetMeshBarycentre();
203 
205  RadiusMaxSquare();
206 
207  void
208  ArcLengthSquareTransform();
209 };
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 # include "itkBorderQuadEdgeMeshFilter.hxx"
214 #endif
215 
216 #endif
itk::BorderQuadEdgeMeshFilter::m_BoundaryPtMap
MapPointIdentifier m_BoundaryPtMap
Definition: itkBorderQuadEdgeMeshFilter.h:184
itk::uint8_t
::uint8_t uint8_t
Definition: itkIntTypes.h:29
itk::AutoPointer
Implements an Automatic Pointer to an object.
Definition: itkAutoPointer.h:46
itk::BorderQuadEdgeMeshFilter::MapPointIdentifier
std::map< InputPointIdentifier, OutputPointIdentifier > MapPointIdentifier
Definition: itkBorderQuadEdgeMeshFilter.h:134
itk::BorderQuadEdgeMeshFilter::OutputEdgeCellType
typename OutputMeshType::EdgeCellType OutputEdgeCellType
Definition: itkBorderQuadEdgeMeshFilter.h:122
itk::BorderQuadEdgeMeshFilter::InputVectorPointType
std::vector< InputPointType > InputVectorPointType
Definition: itkBorderQuadEdgeMeshFilter.h:133
itk::BorderQuadEdgeMeshFilter::InputTraits
typename InputMeshType::Traits InputTraits
Definition: itkBorderQuadEdgeMeshFilter.h:98
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itk::operator<<
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:218
itk::BorderQuadEdgeMeshFilter::m_TransformType
BorderTransformEnum m_TransformType
Definition: itkBorderQuadEdgeMeshFilter.h:177
itkAutoPointer.h
itk::BorderQuadEdgeMeshFilter::InputEdgeListType
typename InputMeshType::EdgeListType InputEdgeListType
Definition: itkBorderQuadEdgeMeshFilter.h:103
itk::BorderQuadEdgeMeshFilter::OutputPointsContainerConstIterator
typename OutputMeshType::PointsContainerConstIterator OutputPointsContainerConstIterator
Definition: itkBorderQuadEdgeMeshFilter.h:126
itk::QuadEdgeMeshBoundaryEdgesMeshFunction
Build a list of references to edges (as GeometricalQuadEdge::RawPointer) each one representing a diff...
Definition: itkQuadEdgeMeshBoundaryEdgesMeshFunction.h:37
itk::BorderQuadEdgeMeshFilter::OutputCellsContainerConstIterator
typename OutputMeshType::CellsContainerConstIterator OutputCellsContainerConstIterator
Definition: itkBorderQuadEdgeMeshFilter.h:127
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::BorderQuadEdgeMeshFilterEnums::BorderTransform
BorderTransform
Definition: itkBorderQuadEdgeMeshFilter.h:39
itk::BorderQuadEdgeMeshFilter::InputPointsContainer
typename InputMeshType::PointsContainer InputPointsContainer
Definition: itkBorderQuadEdgeMeshFilter.h:109
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointsContainerConstIterator
typename InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:62
itk::BorderQuadEdgeMeshFilterEnums::BorderPick::LARGEST
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::BorderQuadEdgeMeshFilter::OutputQEType
typename OutputMeshType::QEType OutputQEType
Definition: itkBorderQuadEdgeMeshFilter.h:119
itk::BorderQuadEdgeMeshFilterEnums::BorderTransform::SQUARE_BORDER_TRANSFORM
itkQuadEdgeMeshToQuadEdgeMeshFilter.h
itk::MeshToMeshFilter::InputMeshType
TInputMesh InputMeshType
Definition: itkMeshToMeshFilter.h:65
itk::BorderQuadEdgeMeshFilterEnums::BorderTransform::DISK_BORDER_TRANSFORM
itk::BorderQuadEdgeMeshFilter::OutputTraits
typename OutputMeshType::Traits OutputTraits
Definition: itkBorderQuadEdgeMeshFilter.h:117
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputMeshConstPointer
typename InputMeshType::ConstPointer InputMeshConstPointer
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:51
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointType
typename InputMeshType::PointType InputPointType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:53
itk::BorderQuadEdgeMeshFilterEnums
Contains all enum classes used by.
Definition: itkBorderQuadEdgeMeshFilter.h:33
itk::BorderQuadEdgeMeshFilter::OutputPolygonCellType
typename OutputMeshType::PolygonCellType OutputPolygonCellType
Definition: itkBorderQuadEdgeMeshFilter.h:123
itk::BorderQuadEdgeMeshFilter::OutputPointsContainer
typename OutputMeshType::PointsContainer OutputPointsContainer
Definition: itkBorderQuadEdgeMeshFilter.h:125
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::BorderQuadEdgeMeshFilter::InputIteratorGeom
typename InputQEType::IteratorGeom InputIteratorGeom
Definition: itkBorderQuadEdgeMeshFilter.h:101
BorderTransform
itk::BorderQuadEdgeMeshFilter::m_BorderPick
BorderPickEnum m_BorderPick
Definition: itkBorderQuadEdgeMeshFilter.h:178
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointIdList
typename InputMeshType::PointIdList InputPointIdList
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:69
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointIdentifier
typename InputMeshType::PointIdentifier InputPointIdentifier
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:54
itk::BorderQuadEdgeMeshFilter
Transform one border of a QuadEdgeMesh into either a circle (conformal) or a square (arclength-wise).
Definition: itkBorderQuadEdgeMeshFilter.h:82
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputVectorType
typename OutputMeshType::VectorType OutputVectorType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:83
itk::QuadEdgeMeshToQuadEdgeMeshFilter
Duplicates the content of a Mesh.
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:37
BorderPick
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputCoordRepType
typename OutputMeshType::CoordRepType OutputCoordRepType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:79
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputEdgeCellType
typename InputMeshType::EdgeCellType InputEdgeCellType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:67
itkQuadEdgeMesh.h
itk::BorderQuadEdgeMeshFilter::InputEdgeListIterator
typename InputEdgeListType::iterator InputEdgeListIterator
Definition: itkBorderQuadEdgeMeshFilter.h:105
itkQuadEdgeMeshBoundaryEdgesMeshFunction.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputCoordRepType
typename InputMeshType::CoordRepType InputCoordRepType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:52
itk::BorderQuadEdgeMeshFilter::m_Radius
InputCoordRepType m_Radius
Definition: itkBorderQuadEdgeMeshFilter.h:180
itk::BorderQuadEdgeMeshFilter::BoundaryRepresentativeEdgesPointer
typename BoundaryRepresentativeEdgesType::Pointer BoundaryRepresentativeEdgesPointer
Definition: itkBorderQuadEdgeMeshFilter.h:138
itk::BorderQuadEdgeMeshFilter::m_Border
InputVectorPointType m_Border
Definition: itkBorderQuadEdgeMeshFilter.h:182
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPolygonCellType
typename InputMeshType::PolygonCellType InputPolygonCellType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:68
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::BorderQuadEdgeMeshFilterEnums::BorderPick::LONGEST
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputVectorType
typename InputMeshType::VectorType InputVectorType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:56
itk::BorderQuadEdgeMeshFilter::OutputPointIdList
typename OutputMeshType::PointIdList OutputPointIdList
Definition: itkBorderQuadEdgeMeshFilter.h:124
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointIdentifier
typename OutputMeshType::PointIdentifier OutputPointIdentifier
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:81
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:80
itk::BorderQuadEdgeMeshFilter::InputQEType
typename InputMeshType::QEType InputQEType
Definition: itkBorderQuadEdgeMeshFilter.h:100
itk::BorderQuadEdgeMeshFilter::OutputEdgeListType
typename OutputMeshType::EdgeListType OutputEdgeListType
Definition: itkBorderQuadEdgeMeshFilter.h:121
itk::BorderQuadEdgeMeshFilterEnums::BorderPick
BorderPick
Definition: itkBorderQuadEdgeMeshFilter.h:48
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputCellsContainerConstIterator
typename InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:64
itk::BorderQuadEdgeMeshFilter::MapPointIdentifierIterator
typename MapPointIdentifier::iterator MapPointIdentifierIterator
Definition: itkBorderQuadEdgeMeshFilter.h:135