|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkVoronoiDiagram2D_h
19 #define itkVoronoiDiagram2D_h
50 template <
typename TCoordinate>
52 :
public Mesh<TCoordinate, 2, DefaultDynamicMeshTraits<TCoordinate, 2, 2, TCoordinate>>
73 static constexpr
unsigned int PointDimension = MeshTraits::PointDimension;
74 static constexpr
unsigned int MaxTopologicalDimension = MeshTraits::MaxTopologicalDimension;
79 #ifndef ITK_FUTURE_LEGACY_REMOVE
80 using CoordRepType ITK_FUTURE_DEPRECATED(
81 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
113 using typename Superclass::CellType;
114 using typename Superclass::CellAutoPointer;
128 itkGetConstMacro(NumberOfSeeds,
unsigned int);
144 NeighborIdsBegin(
int seeds);
147 NeighborIdsEnd(
int seeds);
205 m_CellNeighborsID[x[0]].push_back(x[1]);
206 m_CellNeighborsID[x[1]].push_back(x[0]);
212 m_VoronoiRegions[i]->ClearPoints();
218 m_VoronoiRegions[id]->AddPointId(x);
224 m_VoronoiRegions[id]->BuildEdges();
242 if (this->m_PointsContainer.IsNull())
247 this->m_PointsContainer->Initialize();
253 return static_cast<int>(m_LineList.size());
259 return static_cast<int>(m_EdgeList.size());
265 return static_cast<int>(this->m_PointsContainer->Size());
271 m_LineList.push_back(x);
277 m_EdgeList.push_back(x);
283 this->m_PointsContainer->InsertElement(this->m_PointsContainer->Size(), x);
289 return m_LineList[id];
295 return m_EdgeList[id];
301 return this->m_PointsContainer->ElementAt(
id);
309 x[0] = m_EdgeList[id].m_LeftID;
310 x[1] = m_EdgeList[id].m_RightID;
317 return m_EdgeList[id].m_LineID;
324 PrintSelf(std::ostream & os,
Indent indent)
const override;
328 unsigned int m_NumberOfSeeds{};
329 std::vector<PolygonCellType *> m_VoronoiRegions{};
332 std::vector<std::vector<int>> m_CellNeighborsID{};
334 std::vector<EdgeInfo> m_LineList{};
335 std::vector<VoronoiEdge> m_EdgeList{};
340 #ifndef ITK_MANUAL_INSTANTIATION
341 # include "itkVoronoiDiagram2D.hxx"
SmartPointer< Self > Pointer
typename CellDataContainer::Pointer CellDataContainerPointer
itkMakeCellTraitsMacro CellTraits
std::deque< EdgeInfo > EdgeInfoDQ
typename MeshTraits::PointDataContainer PointDataContainer
void AddCellNeighbor(EdgeInfo x)
CellFeatureIdentifier CellFeatureCount
Implements the 2-Dimensional Voronoi Diagram.
std::list< PointType > PointList
TCoordinate CoordinateType
typename CellsContainer::Iterator CellsContainerIterator
typename PointDataContainer::ConstIterator PointDataContainerIterator
typename PointsContainer::ConstIterator PointsContainerConstIterator
typename MeshTraits::CellIdentifier CellIdentifier
IdentifierType PointIdentifier
ImageBaseType::PointType PointType
TInterpolationWeight InterpolationWeightType
std::set< CellIdentifier > PointCellLinksContainer
Represents a polygon in a Mesh.
Control indentation during Print() invocation.
typename PointsContainer::Iterator PointsContainerIterator
typename MeshTraits::CellsContainer CellsContainer
A visitor that can visit different cell types in a mesh. CellInterfaceVisitor instances can be regist...
A wrapper of the STL "map" container.
typename CellType::CellAutoPointer CellAutoPointer
void AddEdge(VoronoiEdge x)
typename MeshTraits::PointsContainer PointsContainer
typename INTvector::iterator NeighborIdIterator
IdentifierType CellFeatureIdentifier
typename MeshTraits::PointIdentifier PointIdentifier
IdentifierType CellIdentifier
typename CellType::CellAutoPointer CellAutoPointer
typename MeshTraits::CellLinksContainer CellLinksContainer
typename CellsContainer::ConstIterator CellsContainerConstIterator
void AddVert(PointType x)
typename CellDataContainer::ConstIterator CellDataContainerIterator
EdgeInfo GetEdgeEnd(int id)
VoronoiEdge GetEdge(int id)
Represents a line segment for a Mesh.
typename MeshTraits::CellDataContainer CellDataContainer
typename MeshTraits::PixelType PixelType
typename CellLinksContainer::ConstIterator CellLinksContainerIterator
typename MeshTraits::CellFeatureIdentifier CellFeatureIdentifier
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
typename Edge::SelfAutoPointer EdgeAutoPointer
typename PointCellLinksContainer::const_iterator PointCellLinksContainerIterator
std::vector< int > INTvector
typename MeshTraits::CoordinateType CoordinateType
typename MeshTraits::CellAutoPointer genericCellPointer
Implements the N-dimensional mesh structure.
typename MeshTraits::PointType PointType
typename CellsContainer::Pointer CellsContainerPointer
typename CellType::MultiVisitor CellMultiVisitorType
typename SeedsType::iterator SeedsIterator
Base class for most ITK classes.
typename CellLinksContainer::Pointer CellLinksContainerPointer
A templated class holding a geometric point in n-Dimensional space.
int GetEdgeLineID(int id)
void VoronoiRegionAddPointId(int id, int x)
typename std::vector< VoronoiEdge >::iterator VoronoiEdgeIterator
Represent and compute information about bounding boxes.
PointsContainerIterator VertexIterator
typename PointDataContainer::Pointer PointDataContainerPointer
typename BoundingBoxType::Pointer BoundingBoxPointer
typename PointsContainer::Pointer PointsContainerPointer
typename MeshTraits::CellTraits CellTraits
PointType GetVertex(int id)
typename MeshTraits::PointCellLinksContainer PointCellLinksContainer
A simple structure that holds type information for a mesh and its cells.
std::vector< PointType > SeedsType
typename MeshTraits::InterpolationWeightType InterpolationWeightType
Base class for all data objects in ITK.