ITK  4.13.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 
58  typedef QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh,
59  TOutputMesh >
63 
64  typedef TInputMesh InputMeshType;
65  typedef typename InputMeshType::ConstPointer InputMeshConstPointer;
66  typedef typename InputMeshType::CoordRepType InputCoordRepType;
68  typedef typename InputMeshType::Traits InputTraits;
69  typedef typename InputMeshType::PointIdentifier InputPointIdentifier;
70  typedef typename InputMeshType::QEType InputQEType;
71  typedef typename InputQEType::IteratorGeom InputIteratorGeom;
73  typedef typename InputMeshType::EdgeListType InputEdgeListType;
75  typedef typename InputEdgeListType::iterator InputEdgeListIterator;
76  typedef typename InputMeshType::EdgeCellType InputEdgeCellType;
77  typedef typename InputMeshType::PolygonCellType InputPolygonCellType;
78  typedef typename InputMeshType::PointIdList InputPointIdList;
79  typedef typename InputMeshType::PointsContainer InputPointsContainer;
80  typedef typename InputMeshType::PointsContainerConstIterator
82  typedef typename InputMeshType::CellsContainerConstIterator
84 
85  typedef TOutputMesh OutputMeshType;
86  typedef typename OutputMeshType::Pointer OutputMeshPointer;
87  typedef typename OutputMeshType::CoordRepType OutputCoordRepType;
89  typedef typename OutputMeshType::Traits OutputTraits;
90  typedef typename OutputMeshType::PointIdentifier OutputPointIdentifier;
91  typedef typename OutputMeshType::QEType OutputQEType;
93  typedef typename OutputMeshType::EdgeListType OutputEdgeListType;
94  typedef typename OutputMeshType::EdgeCellType OutputEdgeCellType;
95  typedef typename OutputMeshType::PolygonCellType OutputPolygonCellType;
96  typedef typename OutputMeshType::PointIdList OutputPointIdList;
97  typedef typename OutputMeshType::PointsContainer OutputPointsContainer;
98  typedef typename OutputMeshType::PointsContainerConstIterator
100  typedef typename OutputMeshType::CellsContainerConstIterator
102 
103  itkNewMacro(Self);
105  itkStaticConstMacro(PointDimension, unsigned int,
106  InputTraits::PointDimension);
107 
108  typedef std::vector< InputPointType > InputVectorPointType;
109  typedef std::map< InputPointIdentifier, OutputPointIdentifier > MapPointIdentifier;
110  typedef typename MapPointIdentifier::iterator MapPointIdentifierIterator;
111 
114 
116  SQUARE_BORDER_TRANSFORM = 0,
117  DISK_BORDER_TRANSFORM
118  };
119 
121  LONGEST = 0,
122  LARGEST
123  };
124 
125  itkSetMacro(TransformType, BorderTransformType);
126  itkGetConstMacro(TransformType, BorderTransformType);
127 
128  itkSetMacro( BorderPick, BorderPickType );
129  itkGetConstMacro( BorderPick, BorderPickType );
130 
131  itkSetMacro(Radius, InputCoordRepType);
132  itkGetConstMacro(Radius, InputCoordRepType);
133 
134  void ComputeTransform();
135 
136  MapPointIdentifier GetBoundaryPtMap();
137 
138  InputVectorPointType GetBorder();
139 
140 protected:
142 
143  virtual ~BorderQuadEdgeMeshFilter() ITK_OVERRIDE {}
144 
145  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
146 
149 
151 
153 
155 
156  void GenerateData() ITK_OVERRIDE;
157 
158  void ComputeBoundary();
159 
160  InputQEType* ComputeLongestBorder();
161 
162  InputQEType* ComputeLargestBorder();
163 
164  void DiskTransform();
165 
166  InputPointType GetMeshBarycentre();
167 
168  InputCoordRepType RadiusMaxSquare();
169 
170  void ArcLengthSquareTransform();
171 
172 private:
173  ITK_DISALLOW_COPY_AND_ASSIGN(BorderQuadEdgeMeshFilter);
174 };
175 } // end namespace itk
176 
177 #ifndef ITK_MANUAL_INSTANTIATION
178 #include "itkBorderQuadEdgeMeshFilter.hxx"
179 #endif
180 
181 #endif
MapPointIdentifier::iterator MapPointIdentifierIterator
OutputMeshType::EdgeCellType OutputEdgeCellType
InputMeshType::EdgeCellType InputEdgeCellType
OutputMeshType::CellsContainerConstIterator OutputCellsContainerConstIterator
Light weight base class for most itk classes.
InputMeshType::ConstPointer InputMeshConstPointer
OutputMeshType::EdgeListType OutputEdgeListType
std::vector< InputPointType > InputVectorPointType
InputQEType::IteratorGeom InputIteratorGeom
OutputMeshType::PointsContainer OutputPointsContainer
InputMeshType::PointIdList InputPointIdList
InputMeshType::CellsContainerConstIterator InputCellsContainerConstIterator
BoundaryRepresentativeEdgesType::Pointer BoundaryRepresentativeEdgesPointer
AutoPointer< InputEdgeListType > InputEdgeListPointerType
InputMeshType::PointsContainerConstIterator InputPointsContainerConstIterator
OutputMeshType::PointsContainerConstIterator OutputPointsContainerConstIterator
InputMeshType::CoordRepType InputCoordRepType
Build a list of references to edges (as GeometricalQuadEdge::RawPointer) each one representing a diff...
QuadEdgeMeshBoundaryEdgesMeshFunction< InputMeshType > BoundaryRepresentativeEdgesType
InputEdgeListType::iterator InputEdgeListIterator
OutputMeshType::CoordRepType OutputCoordRepType
std::map< InputPointIdentifier, OutputPointIdentifier > MapPointIdentifier
OutputMeshType::PointType OutputPointType
InputMeshType::PolygonCellType InputPolygonCellType
OutputMeshType::VectorType OutputVectorType
InputMeshType::VectorType InputVectorType
QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh > Superclass
Implements an Automatic Pointer to an object.
Transform one border of a QuadEdgeMesh into either a circle (conformal) or a square (arclength-wise)...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
OutputMeshType::PointIdList OutputPointIdList
OutputMeshType::PointIdentifier OutputPointIdentifier
InputMeshType::PointIdentifier InputPointIdentifier
InputMeshType::EdgeListType InputEdgeListType
OutputMeshType::PolygonCellType OutputPolygonCellType
InputMeshType::PointsContainer InputPointsContainer
SmartPointer< const Self > ConstPointer