[vtkusers] how to compute the distance between two 3D points.
Sercani
sercanimailgroups at gmail.com
Fri Jan 30 13:25:39 EST 2009
Hi Chen;
Check out this tutorial : http://devsample.org/index.php?option=com_content
<http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27
> &task=view&id=48&Itemid=27 it is for getting the scalar value of a clicked
point in 2d projection but you must do the similar thing for getting the id
of a clicked point in 3d scene.After getting the point id you can calculate
the structured position of this point using dimensions of imagedata. For
computing the distance of points check out the vtkMath class
http://www.vtk.org/doc/nightly/html/classvtkMath.html#2ae99578ae65acefe517b1
2a7f4068e1 or simply write
dx = Ax-Bx
dy = Ay-By
dz = Az-Bz
distance = sqrt(dx*dx + dy*dy + dz*dz)
Yours sincerely.
Sercani.
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf
Of Dongqing Chen
Sent: Friday, January 30, 2009 8:37 PM
To: vtkusers at vtk.org
Subject: [vtkusers] how to compute the distance between two 3D points.
Dear All:
I have two small questions, and want to ask for any suggestion from this
mail list.
I could display the 3D model (surface rendering), and I may figure out its
2D axial/sagittal/coronal projections, then
1). how could I find the corresponding 2D points on these three projects for
a given 3D point, say, if I have a 3D point on the 3D model, which VTK class
I should use to find its projection pionts on 2D axial, sagittal and
coronal?
2). How could I measure or compute the distance between any 3D points, say,
which VTK class allows me to know its 3D position if I click on a 3D point?
Best Wishes,
----------------------------------------------------------------------------
-
Dongqing Chen, Ph.D.
Computer Vision & Image Processing (CVIP) Lab
Department of Electrical & Computer Engineering
Speed School of Engineering
University of Louisville
Louisville, KY, 40292
U.S.A
email: dqchen at cvip.louisville.edu
phone: 1-502-852-2789 (Lab)
1-502-852-6130 (Office)
----------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090130/95512de6/attachment.htm>
More information about the vtkusers
mailing list