[Insight-users] Obtaining a list of Cell IDs from a point ID

Miller, James V (Research) millerjv at crd.ge.com
Fri Oct 22 09:41:13 EDT 2004


Ferdinando, 
 
If you call mesh->BuildCellLinks() then a data structure is created linking
points back to their cells.  This information is held in the "cell links
container". Calling mesh->GetCellLinks() returns the container of cell
links.  If the mesh is using the default mesh traits, this
container is a VectorContainer (subclass of Object and std::vector) indexed
by the PointId. 
    
    mesh->GetLinks()[PointId] 
 
will return a PointCellLinksContainer.  Again if the mesh trait is the
default mesh trait, the PointCellLinksContainer will be an
std::set<CellIdentifier>.  So by calling
 
   mesh->BuildCellLinks();
 
    MeshType::PointCellLinksContainer cells;
    cells = mesh->GetLinks()[PointId];
 
"cells" will hold the set of cell ids for a point (or the identifiers for
all the cells that use the point referred to by PointId).
 
You can then iterate through this set of cells, to identify neighboring
points.
 
You can get more detailed, looking for points that are actually connected to
a specified point by looking at the edges of the cells. You might want to
look at the 
    
    MeshType::GetCellNeighbors(), 
    MeshType::GetCellBoundaryFeatureNeighbors().
 
 
Jim

-----Original Message-----
From: Ferdinando Rodriguez y Baena
[mailto:ferdinando.rodriguez at imperial.ac.uk]
Sent: Friday, October 22, 2004 7:53 AM
To: insight-users at itk.org
Subject: [Insight-users] Obtaining a list of Cell IDs from a point ID


Hi there,
 
In the itkMesh type, is there any way I can sort cell information according
to a point ID? In other words, I know that each cell contains pointers to a
number of points in the mesh (i.e.  list of point IDs). However, as I am
implementing a mesh closest point search,  I also need to get a list of
cells connected to a specific point. I use a KD tree search of the points to
find the closest vertex in the mesh, but then I need cell information
related to that vertex to search the surrounding facets.
 
Any help would be much appreciated.
 
Thank you.
 
Ferdinando

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20041022/b64ae73d/attachment.html


More information about the Insight-users mailing list