<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hy everyone. I hope somebody can help me!<br>I need to find the distance between 2 points in millimeters like the vtkDistanceWidget does. An user places 10 points and then the program compute the distances. The problem is that I have an array of vtkPoints and I can't use vtkDistanceWidget to find the distances. How I can find the distance? The points positions are inglobal coordinate values. The distance I got are totally wrong. Here is my code: <br><br>int main(int argc, char *argv[])<br>{<br> reader->SetFileName("C:/Tesi/DistanceBetween2Points_build/Debug/Data/Plaque_08.mhd");<br> reader->Update(); <br><br> imgconn=reader->GetOutput();<br><br> //Points Placement with vtkSeedWidget. Poins are stored in a vtkPoints called "points"<br> Seed();<br><br> double punto[3];<br> double punto2[3];<br><br> int num=points->GetNumberOfPoints();<br><br> for (int i=0; i<num; i++)<br> { <br> points->GetPoint(num-1,punto);<br> points->GetPoint(num,punto2);<br><br> double squaredDistance;<br> double dist;<br><br> // Distance<br> squaredDistance = vtkMath::Distance2BetweenPoints(punto, punto2);<br> dist=sqrt(squaredDistance);<br> <br> std::cout << "Distance " << dist << std::endl;<br> <br> }<br><br> return EXIT_SUCCESS;<br>}<br><br>What's the problem? vtkDistanceWidget computes distances using vtkMath::Distance2BetweenPoints. So what am I doing wrong?<br>Thank you!<br>                                            </div></body>
</html>