<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi,</p>
<p style="margin-top:0;margin-bottom:0">I would like to label the keypoint which is closest to the 0, 0, 0 with a marker or label.</p>
<p style="margin-top:0;margin-bottom:0">How can I SetColor to the extracted point?</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Below is my code:</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div><span style="white-space:pre"></span>// Find the k closest points to (0,0,0)</div>
<div><span style="white-space:pre"></span>unsigned int k = 1;</div>
<div><span style="white-space:pre"></span>double testPoint[3] = { 0.0, 0.0, 0.0 };</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>vtkSmartPointer<vtkIdList> result =</div>
<div><span style="white-space:pre"></span>vtkSmartPointer<vtkIdList>::New();</div>
<div><span style="white-space:pre"></span>pointTree->FindClosestNPoints(k, testPoint, result);</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>for (vtkIdType i = 0; i < k; i++)</div>
<div><span style="white-space:pre"></span>{</div>
<div><span style="white-space:pre"></span>vtkIdType point_ind = result->GetId(i);</div>
<div><span style="white-space:pre"></span>double p[3];</div>
<div><span style="white-space:pre"></span>point->GetPoint(point_ind, p);</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>std::cout << "Closest point " << i << ": Point "</div>
<div><span style="white-space:pre"></span><< point_ind << ": (" << p[0] << ", " << p[1] << ", " << p[2] << ")" << std::endl;<span style="white-space:pre">
</span></div>
<div><span style="white-space:pre"></span>}</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0">Thank you so much!</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Regards,</p>
<p style="margin-top:0;margin-bottom:0">Polly</p>
</div>
</body>
</html>