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

Moreland, Kenneth kmorel at sandia.gov
Mon Mar 11 18:42:13 EDT 2013


I understand your description, but I'm a little unsure whether by center you mean the line that follows the center of the tube or some specific point on that line.

There are probably easier ways to do this if your geometry is constrained or your center location is constrained, but it sounds like a skeleton extraction method may give you what you want.  I don't know of any implementation in VTK (someone on the mailing list please correct me if I'm mistaken), but a brief web search led to this paper that looks like it can find the center line of your tube:

http://visgraph.cse.ust.hk/projects/skeleton/

Hope that helps.

-Ken

From: Laurent Chauvin <lchauvin at bwh.harvard.edu<mailto:lchauvin at bwh.harvard.edu>>
Date: Monday, March 11, 2013 4:20 PM
To: Kenneth Moreland <kmorel at sandia.gov<mailto:kmorel at sandia.gov>>
Cc: VTK Developers Developers <vtk-developers at vtk.org<mailto:vtk-developers at vtk.org>>, "vtkusers at vtk.org<mailto:vtkusers at vtk.org>" <vtkusers at vtk.org<mailto:vtkusers at vtk.org>>
Subject: [EXTERNAL] Re: [vtk-developers] Find center of polydata

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<mailto: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<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):

[X]
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130311/c94436b5/attachment.htm>


More information about the vtkusers mailing list