ITK  4.2.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 "itkQuadEdgeMesh.h"
24 
25 namespace itk
26 {
49 template< class TInputMesh, class TOutputMesh=TInputMesh >
50 class ITK_EXPORT BorderQuadEdgeMeshFilter:
51  public QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
52 {
53 public:
54 
57  typedef QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh,
58  TOutputMesh >
62 
63  typedef TInputMesh InputMeshType;
64  typedef typename InputMeshType::ConstPointer InputMeshConstPointer;
65  typedef typename InputMeshType::CoordRepType InputCoordRepType;
66  typedef typename InputMeshType::PointType InputPointType;
67  typedef typename InputMeshType::Traits InputTraits;
68  typedef typename InputMeshType::PointIdentifier InputPointIdentifier;
69  typedef typename InputMeshType::QEType InputQEType;
70  typedef typename InputQEType::IteratorGeom InputIteratorGeom;
71  typedef typename InputMeshType::VectorType InputVectorType;
72  typedef typename InputMeshType::EdgeListType InputEdgeListType;
73  typedef typename InputMeshType::EdgeListPointerType InputEdgeListPointerType;
74  typedef typename InputEdgeListType::iterator InputEdgeListIterator;
75  typedef typename InputMeshType::EdgeCellType InputEdgeCellType;
76  typedef typename InputMeshType::PolygonCellType InputPolygonCellType;
77  typedef typename InputMeshType::PointIdList InputPointIdList;
78  typedef typename InputMeshType::PointsContainer InputPointsContainer;
79  typedef typename InputMeshType::PointsContainerConstIterator
81  typedef typename InputMeshType::CellsContainerConstIterator
83 
84  typedef TOutputMesh OutputMeshType;
85  typedef typename OutputMeshType::Pointer OutputMeshPointer;
86  typedef typename OutputMeshType::CoordRepType OutputCoordRepType;
87  typedef typename OutputMeshType::PointType OutputPointType;
88  typedef typename OutputMeshType::Traits OutputTraits;
89  typedef typename OutputMeshType::PointIdentifier OutputPointIdentifier;
90  typedef typename OutputMeshType::QEType OutputQEType;
91  typedef typename OutputMeshType::VectorType OutputVectorType;
92  typedef typename OutputMeshType::EdgeListType OutputEdgeListType;
93  typedef typename OutputMeshType::EdgeCellType OutputEdgeCellType;
94  typedef typename OutputMeshType::PolygonCellType OutputPolygonCellType;
95  typedef typename OutputMeshType::PointIdList OutputPointIdList;
96  typedef typename OutputMeshType::PointsContainer OutputPointsContainer;
97  typedef typename OutputMeshType::PointsContainerConstIterator
99  typedef typename OutputMeshType::CellsContainerConstIterator
101 
102  itkNewMacro(Self);
104  itkStaticConstMacro(PointDimension, unsigned int,
105  InputTraits::PointDimension);
106 
107  typedef std::vector< InputPointType > InputVectorPointType;
108  typedef std::map< InputPointIdentifier, OutputPointIdentifier > MapPointIdentifier;
109  typedef typename MapPointIdentifier::iterator MapPointIdentifierIterator;
110 
113 
114 public:
115 
117  SQUARE_BORDER_TRANSFORM = 0,
118  DISK_BORDER_TRANSFORM
119  };
120 
122  LONGEST = 0,
123  LARGEST
124  };
125 
126  itkSetMacro(TransformType, BorderTransformType);
127  itkGetConstMacro(TransformType, BorderTransformType);
128 
129  itkSetMacro( BorderPick, BorderPickType );
130  itkGetConstMacro( BorderPick, BorderPickType );
131 
132  itkSetMacro(Radius, InputCoordRepType);
133  itkGetConstMacro(Radius, InputCoordRepType);
134 
135  void ComputeTransform();
136 
137  MapPointIdentifier GetBoundaryPtMap();
138 
139  InputVectorPointType GetBorder();
140 
141 protected:
144 
147 
148  void PrintSelf(std::ostream & os, Indent indent) const;
149 
152 
154 
156 
158 
159  void GenerateData();
160 
161  void ComputeBoundary();
162 
163  InputQEType* ComputeLongestBorder();
164 
165  InputQEType* ComputeLargestBorder();
166 
167  void DiskTransform();
168 
169  InputPointType GetMeshBarycentre();
170 
171  InputCoordRepType RadiusMaxSquare();
172 
173  void ArcLengthSquareTransform();
174 
175 private:
178 
180  void operator=(const Self &);
181 };
182 }
183 #include "itkBorderQuadEdgeMeshFilter.hxx"
184 
185 #endif
186