[vtkusers] Surface registration of two data sets, arethere any vtk algorithms?

George Kamucha kamucha at hfm.e-technik.uni-kassel.de
Mon Feb 5 07:55:54 EST 2001

Hi Sebastien,

I would like first of all to thank you very much for implementing the ICP
class, that was just great! It was a sweet surprise to find it when I came back
from a long holiday a few days ago. However, I still seem to be in a fix,  for
the last two days,  I have been struggling to run the code with my data.
Unfortunately, I have not yet succeeded, partly because I don't have a lot of
experience in VTK which I am learning through a crash program. Would you mind
sending me the code you used in testing your data? I would really appreciate. I
have  especially failed to understand why the following implementation in the
program doesn't seem to work:

// read the first data set and call it mesh
  vtkPolyDataReader *mesh = vtkPolyDataReader::New();
      mesh->SetFileName ("../../../vtkdata/laser.vtk");

// read the second data set and call it target
  vtkPolyDataReader *target = vtkPolyDataReader::New();
      target->SetFileName ("../../../vtkdata/laser1.vtk");

vtksbIterativeClosestPointTransform *icp =
     icp->SetSource (mesh->GetOutput());
     icp->SetTarget (target->GetOutput());
     icp->SetMaximumNumberOfIterations (50);     ....................

I look forward to hearing from you.
Best regards


Sebastien BARRE wrote:

> At 15/12/2000 09:56, George Kamucha wrote:
> >Thanks a lot Tim for the code, I am going to try it with my data. It would
> >really be great if a vtk
> >class existed for this application and I really appreciate your efforts in
> >this. I will inform you
> >of any progress I make with this code. Wish you a merry X-mas too!
> >
> >Best regards
> >
> >George
> Hi Tim, George
> I had a look at it, and implemented the ICP class (as I had some interest
> to test it on my data too :)
> the vtksbIterativeClosestPointTransform is here :
> ftp://sic.sp2mi.univ-poitiers.fr/pub/barre/vtk/classes/
> It's derived from a vtkLinearTransform.
> Here is how it works :
> vtksbIterativeClosestPointTransform icp
>      icp SetSource mesh
>      icp SetTarget target
>      icp SetMaximumNumberOfIterations 50
> and here it is :)
> Use the transform in vtkTransformPolyDataFilter to test the results :
> vtkTransformPolyDataFilter transformf
>      transformf SetInput mesh
>      transformf SetTransform icp
> Now for some sugars :
> - you might stop the iteration process by checking the mean distance
> between two iterated mesh :
>      icp SetCheckMeanDistance 1
>      icp SetMaximumMeanDistance 0.01
> i.e. the mean distance between the new mesh (toward the target) and the
> previous mesh is computed, and if it's lower than MaximumMeanDistance, it
> stops.
> - you might get the last iteration and mean distance values with :
>      icp GetNumberOfIterations
>      icp GetMeanDistance
> - you can provide your own cell locator with :
>    icp SetLocator mylocator
> - you can get the internal vtkLandmarkTransform with :
>      icp GetLandmarkTransform
> - if you dataset is dense, then you will typically not need all its points
> to compute the vtkLandmarkTransform. Use :
>          icp SetMaximumNumberOfLandmarks 50
> to set the maximum number of landmarks to sample on your dataset. Hence, if
> you dataset has 5000 points, it will use every 100 points in the
> vtkLandmarkTransform. This can save you a lot of time.
> Hope it helps
> There might be some bugs, feel free to browse the code.

More information about the vtkusers mailing list