[vtkusers] problem about surface matching using vtkIterativeClosestPointTransform

Zhang zhijun zjzhang at ee.cuhk.edu.hk
Thu Dec 5 09:35:13 EST 2002


Dear all: 

        I want to do a surface matching using 'vtkiterativeclosestpointtransformation' to do a surface matching 
of a ultrasound surface with the MR surface. The result is a bit difference with what I expected. I want to know
if there is some hint on using this method? I have read the document on vtk page, There is very little introduction.
can you give me some advice? Thank you very much. 

Here is my tcl code:
package require vtk
package require vtkinteraction
vtkRenderWindow renWin
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin
vtkRenderer Source 
vtkRenderer Target
Source SetViewport 0 0 0.33 1
Target SetViewport .33 0 0.66 1
renWin AddRenderer Source
renWin AddRenderer Target
vtkPolyDataReader tRead
vtkPolyDataReader sRead
tRead SetFileName "e:/mr.vtk"
sRead SetFileName "e:/us.vtk"
vtkPolyDataMapper sMapper
vtkPolyDataMapper tMapper
sMapper SetInput [sRead GetOutput]
tMapper SetInput [tRead GetOutput]
vtkActor sActor 
vtkActor tActor
sActor SetMapper sMapper
tActor SetMapper tMapper
Source AddActor sActor
Target AddActor tActor 
vtkIterativeClosestPointTransform icp
icp SetSource [sRead GetOutput]
icp SetTarget [tRead GetOutput]
icp SetCheckMeanDistance 1
icp SetMaximumMeanDistance 0.01
icp SetMaximumNumberOfIterations 400
icp SetMaximumNumberOfLandmarks 500
[icp GetLandmarkTransform] SetModeToRigidBody  
vtkTransformPolyDataFilter filter
filter SetInput [sRead GetOutput]
filter SetTransform icp
vtkActor sout
vtkPolyDataMapper soutMapper
soutMapper SetInput [filter GetOutput]
sout SetMapper soutMapper
vtkRenderer soRenderer
soRenderer SetViewport 0.66 0 1 1
soRenderer AddActor sout
renWin AddRenderer soRenderer
renWin SetSize 900 300
renWin Render


regards,
zhang zhijun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021205/c6e2b1db/attachment.htm>


More information about the vtkusers mailing list