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

Sebastien BARRE seb-ml-vtk at barre.nom.fr
Sun Dec 17 16:49:22 EST 2000


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