[vtkusers] Monitor filter

Jon Haitz Legarreta jhlegarreta at vicomtech.org
Mon Feb 24 04:10:13 EST 2014


Dear Massi,
does the standard output show anything? i.e. A rounded output, zero?

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.

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.

HTH,
JON HAITZ

[1] http://www.cplusplus.com/reference/iomanip/setprecision/


On 22 February 2014 21:56, Massinissa Bandou <
Massinissa.Bandou at usherbrooke.ca> wrote:

> Hello everyone!
> Can someone tell me what's wrong with this code? I cant display the mean
> distance
>
> thx for your help!
>
> Massi
>
>
>  vtkSmartPointer<vtkIterativeClosestPointTransform> icp =
> vtkSmartPointer<vtkIterativeClosestPointTransform>::New();
>         icp->SetSource(sourceData);
>         icp->SetTarget(targetData);
>         icp->SetMaximumNumberOfIterations(40);
>         icp->GetLandmarkTransform()->SetModeToRigidBody();
>         icp->CheckMeanDistanceOn();
>         icp->SetMeanDistanceModeToRMS();
>
>
> icp->AddObserver(vtkCommand::ProgressEvent,this,&Surface_Registration::ICPCallback);
>         icp->Modified();
>         icp->Update();
>
> void Surface_Registration::ICPCallback(vtkObject* caller,long unsigned int
> eventId,void* callData)
> {
>         vtkIterativeClosestPointTransform* progress =
> reinterpret_cast<vtkIterativeClosestPointTransform*>(caller);
>         cout<<progress->GetMeanDistance()<<endl;
> }
>
> </h3>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Monitor-filter-tp5726082.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140224/0e6ed177/attachment.html>


More information about the vtkusers mailing list