[vtkusers] vtkIterativeClosestPointTransform

Adam Gibson agibson at medphys.ucl.ac.uk
Thu Jun 27 08:09:13 EDT 2002


Hello

I'm working in medical imaging, trying to fit a generic head-shaped surface to 
a set of points measured on an individual patient's scalp. In the first 
instance, I'm fitting a sphere to 29 measured points unevenly spread over the 
back of the head. I want to move the sphere using 
vtkIterativeClosestPointTransform so it best fits these points. 

My sphere is generated by vtkSphereSource, and I'm reading my points in from a 
file so they're vtkPoints. If I run vtkIterativeClosestPointTransform with 
the sphere as source and points as target, like this:

vtkIterativeClosestPointTransform icp
  icp SetSource [sphere GetOutput]
  icp SetTarget [pointSource GetOutput]

I get the error message
Error in startup script: Object named: pointSource, could not find requested 
method: GetOutput or the method was called with incorrect arguments.

So I tried converting the points to a vtkPolyData surface. I could display the 
sphere and the new surface nicely but when I ran 
vtkIterativeClosestPointTransform, I got a different error 
ERROR: In 
/home/adam/downloads/vtk/VTK/Hybrid/vtkIterativeClosestPointTransform.cxx, 
line 317
vtkIterativeClosestPointTransform (0x8fa4a00): Can't execute with NULL or 
empty target

Can anybody tell me what I'm doing wrong? Or even better, how to fix it? 

Thanks - I'm new to VTK so please go easy in your replies!

Adam Gibson

-- 
-------------------------------------------
Adam Gibson PhD

Dept. Medical Physics and Bioengineering
1st Floor Shropshire House, 11-20 Capper St
London WC1E 6JA
020 7679 6415
www.medphys.ucl.ac.uk/~agibson/





More information about the vtkusers mailing list