[vtkusers] [vtk-developers] Find center of polydata

David Thompson david.thompson at kitware.com
Tue Mar 12 00:02:35 EDT 2013


Hi Laurent,

I think you mean that you are looking for a point on the medial axis of the shape. VTK does not have a filter to compute medial axes that I am aware of. It is generally not considered numerically well-conditioned for polyhedral meshes as small changes in the surface polygonization can lead to large changes in the shape of the medial axis.

Also, as the name suggests, the medial axis is generally not a single point. There are other techniques for parameterizing shapes along their "longitudinal" axes. The closest thing that comes to mind is the Reeb graph filter in VTK ( https://visimp.cs.unc.edu/2010/10/26/reeb-graphs/ ) but it requires you to have a scalar field that defines the start and end points of graph edges embedded in the model (as illustrated by the link above). Some applications ( http://www.mcs.anl.gov/uploads/cels/papers/scidac11/final/bennett_janine.scidac.pdf ) use eigenvectors of point coordinates to come up with such a scalar field.

	David

On Mar 11, 2013, at 6:22 PM, Laurent Chauvin <lchauvin at bwh.harvard.edu> wrote:

> Hello Kenneth,
> 
> Thank you for your explanations.
> However, when I meant on the surface, I was not taking about the center.
> 
> My goal is not to have the center of the complete polydata, because if it's a U shape or S shape for example, the center could be in empty space (between the two | of the U). 
> For example, let's say the U shape is a tube with a U shape. I don't want the center of the U shape, but the center of the tube, all along the U shape.
> 
> I don't know if it's clearer.
> 
> If it's not, let me know I will try to make a 3D drawing.
> 
> Thank you very much.
> -Laurent
> 
> 
> On Mon, Mar 11, 2013 at 6:20 PM, Laurent Chauvin <lchauvin at bwh.harvard.edu> wrote:
> Hello Kenneth,
> 
> Thank you for your explanations.
> However, when I meant on the surface, I was not taking about the center.
> 
> My goal is not to have the center of the complete polydata, because if it's a U shape or S shape for example, the center could be in empty space (between the two | of the U). 
> For example, let's say the U shape is a tube with a U shape. I don't want the center of the U shape, but the center of the tube, all along the U shape.
> 
> I don't know if it's clearer.
> 
> If it's not, let me know I will try to make a 3D drawing.
> 
> Thank you very much.
> -Laurent
> 
> 
> 
> On Mon, Mar 11, 2013 at 2:37 PM, Moreland, Kenneth <kmorel at sandia.gov> wrote:
> Laurent,
> 
> (This discussion is probably more appropriate to VTK users, so I'm forwarding it there.)
> 
> Although, I don't know for sure, but I suspect that the short answer to your question is no.
> 
> The problem is that you have not given a clear definition of what "center" means.  Center of mass is well defined even if, as you stated, there is no guarantee that it in the mass or on the surface.  I'm not sure what you mean by "center… close to the fiducial".  Center, by any definition, is absolute relative to an object.  It is either close or not close.
> 
> I can think of two approaches that might satisfy what you are asking for.  First, you can find the polygon cell close to or under a selected position and find the center of that polygon.  As long as the polygon is planar and concave, this center will lie on that polygon.
> 
> Otherwise, perhaps you mean the center relative to part of the object within some region around the selected point.  You could then extract those cells within the region and take the center of that.  Be wary, though, that the center is still not guaranteed to be located on the surface (and is most likely not going to be if the surface is not in a plane).
> 
> -Ken
> 
> From: Laurent Chauvin <lchauvin at bwh.harvard.edu>
> Date: Monday, March 11, 2013 10:43 AM
> To: VTK Developers Developers <vtk-developers at vtk.org>
> Subject: [EXTERNAL] [vtk-developers] Find center of polydata
> 
> Hello,
> 
> I would like to know if there is a vtk object that can find the center of the vtkPolyData.
> I've seen there is vtkCenterOfMass but I'm not sure it's gonna fit.
> 
> My concern is if I use a U shape dataset (or S shape, or another strange shape), I feel like the center returned will be in the middle of the U.
> What I would like is a "local" center, like this (the green one, not the red):
> 
> 
> I would like to do this without having to define a ROI. 
> I would like for example to place a fiducial on model, and then, find the center of the model close to the fiducial I placed.
> 
> Is there any tool like this ?
> 
> Thank you very much.
> -Laurent
> 
> 
> 
> 
> 
> 
> -- 
> Laurent Chauvin, MS
> Surgical Navigation and Robotics Laboratory, Radiology
> Brigham And Women's Hospital, Harvard Medical School
> http://wiki.ncigt.org/index.php/User:Lchauvin
> 
> 
> 
> -- 
> Laurent Chauvin, MS
> Surgical Navigation and Robotics Laboratory, Radiology
> Brigham And Women's Hospital, Harvard Medical School
> http://wiki.ncigt.org/index.php/User:Lchauvin
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list