[vtkusers] [vtk-developers] Find center of polydata
Moreland, Kenneth
kmorel at sandia.gov
Mon Mar 11 14:37:43 EDT 2013
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<mailto:lchauvin at bwh.harvard.edu>>
Date: Monday, March 11, 2013 10:43 AM
To: VTK Developers Developers <vtk-developers at vtk.org<mailto: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):
[cid:B4836B0F-1B68-4637-B882-1ADA129D756D at bwh.harvard.edu]
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130311/8c5f6549/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2013-03-11 at 12.41.04 PM.png
Type: image/png
Size: 13979 bytes
Desc: Screen Shot 2013-03-11 at 12.41.04 PM.png
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130311/8c5f6549/attachment.png>
More information about the vtkusers
mailing list