<div dir="ltr"><div>Dear Massi,<br></div>does the standard output show anything? i.e. A rounded output, zero? <br><div><div><div class="gmail_extra"><br></div><div class="gmail_extra">In theory, for a floating point number, if you do not set the precision [1], std::cout will round/limit the precision of the output to be displayed.<br>
<br></div><div class="gmail_extra">If you don't assume that the rest of your program is right, you can try storing the mean distance value in a variable and then see whether it actually contains some "expected" value.<br>
<br></div><div class="gmail_extra">HTH,<br>JON HAITZ<br><br></div><div class="gmail_extra">[1] <a href="http://www.cplusplus.com/reference/iomanip/setprecision/">http://www.cplusplus.com/reference/iomanip/setprecision/</a><br>
<br><br><div class="gmail_quote">On 22 February 2014 21:56, Massinissa Bandou <span dir="ltr"><<a href="mailto:Massinissa.Bandou@usherbrooke.ca" target="_blank">Massinissa.Bandou@usherbrooke.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello everyone!<br>
Can someone tell me what's wrong with this code? I cant display the mean<br>
distance<br>
<br>
thx for your help!<br>
<br>
Massi<br>
<br>
<br>
vtkSmartPointer<vtkIterativeClosestPointTransform> icp =<br>
vtkSmartPointer<vtkIterativeClosestPointTransform>::New();<br>
icp->SetSource(sourceData);<br>
icp->SetTarget(targetData);<br>
icp->SetMaximumNumberOfIterations(40);<br>
icp->GetLandmarkTransform()->SetModeToRigidBody();<br>
icp->CheckMeanDistanceOn();<br>
icp->SetMeanDistanceModeToRMS();<br>
<br>
icp->AddObserver(vtkCommand::ProgressEvent,this,&Surface_Registration::ICPCallback);<br>
icp->Modified();<br>
icp->Update();<br>
<br>
void Surface_Registration::ICPCallback(vtkObject* caller,long unsigned int<br>
eventId,void* callData)<br>
{<br>
vtkIterativeClosestPointTransform* progress =<br>
reinterpret_cast<vtkIterativeClosestPointTransform*>(caller);<br>
cout<<progress->GetMeanDistance()<<endl;<br>
}<br>
<br>
</h3><br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Monitor-filter-tp5726082.html" target="_blank">http://vtk.1045678.n5.nabble.com/Monitor-filter-tp5726082.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div></div></div></div>