18#ifndef itkVoronoiDiagram2D_h
19#define itkVoronoiDiagram2D_h
50template <
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);
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;
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"
Represent and compute information about bounding boxes.
A visitor that can visit different cell types in a mesh. CellInterfaceVisitor instances can be regist...
Base class for all data objects in ITK.
A simple structure that holds type information for a mesh and its cells.
typename CellType::CellAutoPointer CellAutoPointer
TInterpolationWeight InterpolationWeightType
IdentifierType PointIdentifier
IdentifierType CellIdentifier
itkMakeCellTraitsMacro CellTraits
TCoordinate CoordinateType
std::set< CellIdentifier > PointCellLinksContainer
IdentifierType CellFeatureIdentifier
Control indentation during Print() invocation.
Represents a line segment for a Mesh.
A wrapper of the STL "map" container.
Implements the N-dimensional mesh structure.
typename CellType::CellAutoPointer CellAutoPointer
Base class for most ITK classes.
A templated class holding a geometric point in n-Dimensional space.
Represents a polygon in a Mesh.
Implements the 2-Dimensional Voronoi Diagram.
typename CellLinksContainer::ConstIterator CellLinksContainerIterator
void SetBoundary(PointType vorsize)
typename SeedsType::iterator SeedsIterator
~VoronoiDiagram2D() override=default
void AddVert(PointType x)
VoronoiEdge GetEdge(int id)
typename MeshTraits::PointCellLinksContainer PointCellLinksContainer
typename BoundingBoxType::Pointer BoundingBoxPointer
typename MeshTraits::CellIdentifier CellIdentifier
PointsContainerIterator VertexIterator
typename MeshTraits::PointIdentifier PointIdentifier
void SetSeeds(int num, SeedsIterator begin)
std::vector< PointType > SeedsType
typename CellsContainer::Pointer CellsContainerPointer
VoronoiEdgeIterator EdgeBegin()
typename MeshTraits::CoordinateType CoordinateType
typename PointCellLinksContainer::const_iterator PointCellLinksContainerIterator
typename MeshTraits::CellTraits CellTraits
typename PointsContainer::Iterator PointsContainerIterator
typename MeshTraits::CellAutoPointer genericCellPointer
typename PointDataContainer::Pointer PointDataContainerPointer
PointType GetVertex(int id)
typename MeshTraits::PointsContainer PointsContainer
typename PointsContainer::Pointer PointsContainerPointer
PointType GetSeed(int SeedID)
void SetOrigin(PointType vorsize)
typename std::vector< VoronoiEdge >::iterator VoronoiEdgeIterator
void VoronoiRegionAddPointId(int id, int x)
typename MeshTraits::PointType PointType
typename MeshTraits::InterpolationWeightType InterpolationWeightType
NeighborIdIterator NeighborIdsEnd(int seeds)
typename MeshTraits::CellsContainer CellsContainer
void AddEdge(VoronoiEdge x)
void PrintSelf(std::ostream &os, Indent indent) const override
typename PointDataContainer::ConstIterator PointDataContainerIterator
typename CellDataContainer::Pointer CellDataContainerPointer
void AddCellNeighbor(EdgeInfo x)
typename MeshTraits::PixelType PixelType
typename Edge::SelfAutoPointer EdgeAutoPointer
typename CellsContainer::Iterator CellsContainerIterator
typename INTvector::iterator NeighborIdIterator
typename CellType::MultiVisitor CellMultiVisitorType
NeighborIdIterator NeighborIdsBegin(int seeds)
void GetCellId(CellIdentifier cellId, CellAutoPointer &)
VertexIterator VertexBegin()
int GetEdgeLineID(int id)
void GetPoint(int pId, PointType *answer)
EdgeInfo GetSeedsIDAroundEdge(VoronoiEdge *task)
VoronoiEdgeIterator EdgeEnd()
typename PointsContainer::ConstIterator PointsContainerConstIterator
VertexIterator VertexEnd()
std::deque< EdgeInfo > EdgeInfoDQ
typename CellLinksContainer::Pointer CellLinksContainerPointer
typename CellDataContainer::ConstIterator CellDataContainerIterator
typename MeshTraits::PointDataContainer PointDataContainer
typename CellsContainer::ConstIterator CellsContainerConstIterator
typename MeshTraits::CellLinksContainer CellLinksContainer
std::vector< int > INTvector
typename MeshTraits::CellFeatureIdentifier CellFeatureIdentifier
EdgeInfo GetEdgeEnd(int id)
typename MeshTraits::CellDataContainer CellDataContainer
std::list< PointType > PointList
CellFeatureIdentifier CellFeatureCount
SmartPointer< Self > Pointer
ImageBaseType::PointType PointType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....