ITK  6.0.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  * 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 #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);
93 
94  using InputMeshType = TInputMesh;
96  using InputCoordinateType = typename InputMeshType::CoordinateType;
97 #ifndef ITK_FUTURE_LEGACY_REMOVE
98  using InputCoordRepType ITK_FUTURE_DEPRECATED(
99  "ITK 6 discourages using `InputCoordRepType`. Please use `InputCoordinateType` instead!") = InputCoordinateType;
100 #endif
102  using InputTraits = typename InputMeshType::Traits;
103  using InputPointIdentifier = typename InputMeshType::PointIdentifier;
104  using InputQEType = typename InputMeshType::QEType;
105  using InputIteratorGeom = typename InputQEType::IteratorGeom;
107  using InputEdgeListType = typename InputMeshType::EdgeListType;
109  using InputEdgeListIterator = typename InputEdgeListType::iterator;
110  using InputEdgeCellType = typename InputMeshType::EdgeCellType;
111  using InputPolygonCellType = typename InputMeshType::PolygonCellType;
112  using InputPointIdList = typename InputMeshType::PointIdList;
113  using InputPointsContainer = typename InputMeshType::PointsContainer;
114  using InputPointsContainerConstIterator = typename InputMeshType::PointsContainerConstIterator;
115  using InputCellsContainerConstIterator = typename InputMeshType::CellsContainerConstIterator;
116 
117  using OutputMeshType = TOutputMesh;
119  using OutputCoordinateType = typename OutputMeshType::CoordinateType;
120 #ifndef ITK_FUTURE_LEGACY_REMOVE
121  using OutputCoordRepType ITK_FUTURE_DEPRECATED(
122  "ITK 6 discourages using `OutputCoordRepType`. Please use `OutputCoordinateType` instead!") = OutputCoordinateType;
123 #endif
125  using OutputTraits = typename OutputMeshType::Traits;
126  using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
127  using OutputQEType = typename OutputMeshType::QEType;
129  using OutputEdgeListType = typename OutputMeshType::EdgeListType;
130  using OutputEdgeCellType = typename OutputMeshType::EdgeCellType;
131  using OutputPolygonCellType = typename OutputMeshType::PolygonCellType;
132  using OutputPointIdList = typename OutputMeshType::PointIdList;
133  using OutputPointsContainer = typename OutputMeshType::PointsContainer;
134  using OutputPointsContainerConstIterator = typename OutputMeshType::PointsContainerConstIterator;
135  using OutputCellsContainerConstIterator = typename OutputMeshType::CellsContainerConstIterator;
136 
137  itkNewMacro(Self);
138  itkOverrideGetNameOfClassMacro(BorderQuadEdgeMeshFilter);
139  static constexpr unsigned int PointDimension = InputTraits::PointDimension;
140 
141  using InputVectorPointType = std::vector<InputPointType>;
142  using MapPointIdentifier = std::map<InputPointIdentifier, OutputPointIdentifier>;
143  using MapPointIdentifierIterator = typename MapPointIdentifier::iterator;
144 
147 
150 #if !defined(ITK_LEGACY_REMOVE)
151 
152  static constexpr BorderTransformEnum SQUARE_BORDER_TRANSFORM = BorderTransformEnum::SQUARE_BORDER_TRANSFORM;
153  static constexpr BorderTransformEnum DISK_BORDER_TRANSFORM = BorderTransformEnum::DISK_BORDER_TRANSFORM;
154 
155  static constexpr BorderPickEnum LONGEST = BorderPickEnum::LONGEST;
156  static constexpr BorderPickEnum LARGEST = BorderPickEnum::LARGEST;
157 #endif
158 
159  itkSetEnumMacro(TransformType, BorderTransformEnum);
160  itkGetConstMacro(TransformType, BorderTransformEnum);
161 
162  itkSetEnumMacro(BorderPick, BorderPickEnum);
163  itkGetConstMacro(BorderPick, BorderPickEnum);
164 
165  itkSetMacro(Radius, InputCoordinateType);
166  itkGetConstMacro(Radius, InputCoordinateType);
167 
168  void
169  ComputeTransform();
170 
172  GetBoundaryPtMap();
173 
175  GetBorder();
176 
177 protected:
179 
180  ~BorderQuadEdgeMeshFilter() override = default;
181 
182  void
183  PrintSelf(std::ostream & os, Indent indent) const override;
184 
185  BorderTransformEnum m_TransformType{};
186  BorderPickEnum m_BorderPick{};
187 
189 
191 
192  MapPointIdentifier m_BoundaryPtMap{};
193 
194  void
195  GenerateData() override;
196 
197  void
198  ComputeBoundary();
199 
200  InputQEType *
201  ComputeLongestBorder();
202 
203  InputQEType *
204  ComputeLargestBorder();
205 
206  void
207  DiskTransform();
208 
209  InputPointType
210  GetMeshBarycentre();
211 
212  InputCoordinateType
213  RadiusMaxSquare();
214 
215  void
216  ArcLengthSquareTransform();
217 };
218 } // end namespace itk
219 
220 #ifndef ITK_MANUAL_INSTANTIATION
221 # include "itkBorderQuadEdgeMeshFilter.hxx"
222 #endif
223 
224 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::AutoPointer
Implements an Automatic Pointer to an object.
Definition: itkAutoPointer.h:46
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::BorderQuadEdgeMeshFilter::MapPointIdentifier
std::map< InputPointIdentifier, OutputPointIdentifier > MapPointIdentifier
Definition: itkBorderQuadEdgeMeshFilter.h:142
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputCoordinateType
typename InputMeshType::CoordinateType InputCoordinateType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:52
itk::BorderQuadEdgeMeshFilter::OutputEdgeCellType
typename OutputMeshType::EdgeCellType OutputEdgeCellType
Definition: itkBorderQuadEdgeMeshFilter.h:130
itk::BorderQuadEdgeMeshFilter::InputVectorPointType
std::vector< InputPointType > InputVectorPointType
Definition: itkBorderQuadEdgeMeshFilter.h:141
itk::BorderQuadEdgeMeshFilter::InputTraits
typename InputMeshType::Traits InputTraits
Definition: itkBorderQuadEdgeMeshFilter.h:102
itk::MeshSource::OutputMeshPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
itkAutoPointer.h
itk::BorderQuadEdgeMeshFilter::InputEdgeListType
typename InputMeshType::EdgeListType InputEdgeListType
Definition: itkBorderQuadEdgeMeshFilter.h:107
itk::BorderQuadEdgeMeshFilter::OutputPointsContainerConstIterator
typename OutputMeshType::PointsContainerConstIterator OutputPointsContainerConstIterator
Definition: itkBorderQuadEdgeMeshFilter.h:134
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:135
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:113
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointsContainerConstIterator
typename InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:66
itk::BorderQuadEdgeMeshFilterEnums::BorderPick::LARGEST
itk::operator<<
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::BorderQuadEdgeMeshFilter::OutputQEType
typename OutputMeshType::QEType OutputQEType
Definition: itkBorderQuadEdgeMeshFilter.h:127
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:125
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputMeshConstPointer
typename InputMeshType::ConstPointer InputMeshConstPointer
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:51
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointType
typename InputMeshType::PointType InputPointType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:57
itk::BorderQuadEdgeMeshFilterEnums
Contains all enum classes used by.
Definition: itkBorderQuadEdgeMeshFilter.h:33
itk::BorderQuadEdgeMeshFilter::OutputPolygonCellType
typename OutputMeshType::PolygonCellType OutputPolygonCellType
Definition: itkBorderQuadEdgeMeshFilter.h:131
itk::BorderQuadEdgeMeshFilter::OutputPointsContainer
typename OutputMeshType::PointsContainer OutputPointsContainer
Definition: itkBorderQuadEdgeMeshFilter.h:133
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::BorderQuadEdgeMeshFilter::InputIteratorGeom
typename InputQEType::IteratorGeom InputIteratorGeom
Definition: itkBorderQuadEdgeMeshFilter.h:105
BorderTransform
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointIdList
typename InputMeshType::PointIdList InputPointIdList
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:73
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPointIdentifier
typename InputMeshType::PointIdentifier InputPointIdentifier
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:58
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:91
itk::QuadEdgeMeshToQuadEdgeMeshFilter
Duplicates the content of a Mesh.
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:37
BorderPick
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputCoordinateType
typename OutputMeshType::CoordinateType OutputCoordinateType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:83
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputEdgeCellType
typename InputMeshType::EdgeCellType InputEdgeCellType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:71
itkQuadEdgeMesh.h
itk::BorderQuadEdgeMeshFilter::InputEdgeListIterator
typename InputEdgeListType::iterator InputEdgeListIterator
Definition: itkBorderQuadEdgeMeshFilter.h:109
itkQuadEdgeMeshBoundaryEdgesMeshFunction.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::BorderQuadEdgeMeshFilter::BoundaryRepresentativeEdgesPointer
typename BoundaryRepresentativeEdgesType::Pointer BoundaryRepresentativeEdgesPointer
Definition: itkBorderQuadEdgeMeshFilter.h:146
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputPolygonCellType
typename InputMeshType::PolygonCellType InputPolygonCellType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:72
itk::MeshSource::OutputMeshType
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
itk::BorderQuadEdgeMeshFilterEnums::BorderPick::LONGEST
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputVectorType
typename InputMeshType::VectorType InputVectorType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:60
itk::BorderQuadEdgeMeshFilter::OutputPointIdList
typename OutputMeshType::PointIdList OutputPointIdList
Definition: itkBorderQuadEdgeMeshFilter.h:132
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointIdentifier
typename OutputMeshType::PointIdentifier OutputPointIdentifier
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:89
itk::QuadEdgeMeshToQuadEdgeMeshFilter::OutputPointType
typename OutputMeshType::PointType OutputPointType
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:88
itk::BorderQuadEdgeMeshFilter::InputQEType
typename InputMeshType::QEType InputQEType
Definition: itkBorderQuadEdgeMeshFilter.h:104
itk::BorderQuadEdgeMeshFilter::OutputEdgeListType
typename OutputMeshType::EdgeListType OutputEdgeListType
Definition: itkBorderQuadEdgeMeshFilter.h:129
itk::BorderQuadEdgeMeshFilterEnums::BorderPick
BorderPick
Definition: itkBorderQuadEdgeMeshFilter.h:48
itk::QuadEdgeMeshToQuadEdgeMeshFilter::InputCellsContainerConstIterator
typename InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator
Definition: itkQuadEdgeMeshToQuadEdgeMeshFilter.h:68
itk::BorderQuadEdgeMeshFilter::MapPointIdentifierIterator
typename MapPointIdentifier::iterator MapPointIdentifierIterator
Definition: itkBorderQuadEdgeMeshFilter.h:143