ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBorderQuadEdgeMeshFilter.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 #ifndef itkBorderQuadEdgeMeshFilter_h
19 #define itkBorderQuadEdgeMeshFilter_h
20 
21 #include "itkAutoPointer.h"
22 #include "itkQuadEdgeMesh.h"
25 
26 namespace itk
27 {
50 template< typename TInputMesh, typename TOutputMesh=TInputMesh >
51 class ITK_TEMPLATE_EXPORT BorderQuadEdgeMeshFilter:
52  public QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_ASSIGN(BorderQuadEdgeMeshFilter);
57 
60  using Superclass = QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh,
61  TOutputMesh >;
64 
65  using InputMeshType = TInputMesh;
66  using InputMeshConstPointer = typename InputMeshType::ConstPointer;
67  using InputCoordRepType = typename InputMeshType::CoordRepType;
69  using InputTraits = typename InputMeshType::Traits;
70  using InputPointIdentifier = typename InputMeshType::PointIdentifier;
71  using InputQEType = typename InputMeshType::QEType;
72  using InputIteratorGeom = typename InputQEType::IteratorGeom;
74  using InputEdgeListType = typename InputMeshType::EdgeListType;
76  using InputEdgeListIterator = typename InputEdgeListType::iterator;
77  using InputEdgeCellType = typename InputMeshType::EdgeCellType;
78  using InputPolygonCellType = typename InputMeshType::PolygonCellType;
79  using InputPointIdList = typename InputMeshType::PointIdList;
80  using InputPointsContainer = typename InputMeshType::PointsContainer;
81  using InputPointsContainerConstIterator = typename InputMeshType::PointsContainerConstIterator;
82  using InputCellsContainerConstIterator = typename InputMeshType::CellsContainerConstIterator;
83 
84  using OutputMeshType = TOutputMesh;
85  using OutputMeshPointer = typename OutputMeshType::Pointer;
86  using OutputCoordRepType = typename OutputMeshType::CoordRepType;
88  using OutputTraits = typename OutputMeshType::Traits;
89  using OutputPointIdentifier = typename OutputMeshType::PointIdentifier;
90  using OutputQEType = typename OutputMeshType::QEType;
92  using OutputEdgeListType = typename OutputMeshType::EdgeListType;
93  using OutputEdgeCellType = typename OutputMeshType::EdgeCellType;
94  using OutputPolygonCellType = typename OutputMeshType::PolygonCellType;
95  using OutputPointIdList = typename OutputMeshType::PointIdList;
96  using OutputPointsContainer = typename OutputMeshType::PointsContainer;
97  using OutputPointsContainerConstIterator = typename OutputMeshType::PointsContainerConstIterator;
98  using OutputCellsContainerConstIterator = typename OutputMeshType::CellsContainerConstIterator;
99 
100  itkNewMacro(Self);
102  static constexpr unsigned int PointDimension = InputTraits::PointDimension;
103 
104  using InputVectorPointType = std::vector< InputPointType >;
105  using MapPointIdentifier = std::map< InputPointIdentifier, OutputPointIdentifier >;
106  using MapPointIdentifierIterator = typename MapPointIdentifier::iterator;
107 
110 
112  SQUARE_BORDER_TRANSFORM = 0,
113  DISK_BORDER_TRANSFORM
114  };
115 
117  LONGEST = 0,
118  LARGEST
119  };
120 
121  itkSetMacro(TransformType, BorderTransformType);
122  itkGetConstMacro(TransformType, BorderTransformType);
123 
124  itkSetMacro( BorderPick, BorderPickType );
125  itkGetConstMacro( BorderPick, BorderPickType );
126 
127  itkSetMacro(Radius, InputCoordRepType);
128  itkGetConstMacro(Radius, InputCoordRepType);
129 
130  void ComputeTransform();
131 
132  MapPointIdentifier GetBoundaryPtMap();
133 
134  InputVectorPointType GetBorder();
135 
136 protected:
138 
139  ~BorderQuadEdgeMeshFilter() override = default;
140 
141  void PrintSelf(std::ostream & os, Indent indent) const override;
142 
145 
147 
149 
151 
152  void GenerateData() override;
153 
154  void ComputeBoundary();
155 
156  InputQEType* ComputeLongestBorder();
157 
158  InputQEType* ComputeLargestBorder();
159 
160  void DiskTransform();
161 
162  InputPointType GetMeshBarycentre();
163 
164  InputCoordRepType RadiusMaxSquare();
165 
166  void ArcLengthSquareTransform();
167 };
168 } // end namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "itkBorderQuadEdgeMeshFilter.hxx"
172 #endif
173 
174 #endif
typename InputEdgeListType::iterator InputEdgeListIterator
typename InputMeshType::CoordRepType InputCoordRepType
typename OutputMeshType::Traits OutputTraits
Light weight base class for most itk classes.
TOutputMesh OutputMeshType
Definition: itkMeshSource.h:68
typename OutputMeshType::PolygonCellType OutputPolygonCellType
typename OutputMeshType::EdgeCellType OutputEdgeCellType
std::vector< InputPointType > InputVectorPointType
typename InputMeshType::PointIdentifier InputPointIdentifier
typename InputMeshType::ConstPointer InputMeshConstPointer
typename InputMeshType::PolygonCellType InputPolygonCellType
typename OutputMeshType::PointIdentifier OutputPointIdentifier
std::map< InputPointIdentifier, OutputPointIdentifier > MapPointIdentifier
typename OutputMeshType::CoordRepType OutputCoordRepType
typename InputMeshType::QEType InputQEType
typename InputMeshType::Traits InputTraits
typename InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator
Build a list of references to edges (as GeometricalQuadEdge::RawPointer) each one representing a diff...
typename InputMeshType::EdgeListType InputEdgeListType
typename OutputMeshType::PointsContainerConstIterator OutputPointsContainerConstIterator
typename InputQEType::IteratorGeom InputIteratorGeom
typename OutputMeshType::PointIdList OutputPointIdList
typename OutputMeshType::EdgeListType OutputEdgeListType
typename BoundaryRepresentativeEdgesType::Pointer BoundaryRepresentativeEdgesPointer
typename OutputMeshType::Pointer OutputMeshPointer
Definition: itkMeshSource.h:69
typename OutputMeshType::CellsContainerConstIterator OutputCellsContainerConstIterator
typename OutputMeshType::PointsContainer OutputPointsContainer
typename InputMeshType::EdgeCellType InputEdgeCellType
Implements an Automatic Pointer to an object.
Transform one border of a QuadEdgeMesh into either a circle (conformal) or a square (arclength-wise)...
typename OutputMeshType::QEType OutputQEType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename OutputMeshType::VectorType OutputVectorType
typename InputMeshType::PointsContainer InputPointsContainer
typename InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator
typename MapPointIdentifier::iterator MapPointIdentifierIterator
typename InputMeshType::PointIdList InputPointIdList