<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hi,<BR>
 <BR>
   I  have a problem using <FONT size=2>vtkIterativeClosestPointTransform, if anyone could help that would be great! </FONT>I have searched on the old vtk questions and found someone with a similar problem, but nothing is working to solve it for me. Here is the error I get when executing: <BR>
 <BR>
 <BR>
<FONT color=#000000>ERROR: In ..\..\..\Installations\VTK\VTK5\Hybrid\vtkIterativeClosestPointTransform.cxx, line271</FONT><BR>
<FONT color=#000000>vtkIterativeClosestPointTransform[12ABE78]: Can't execute with NULL or empty input</FONT><BR>
 <BR>
and here is the code I use:<BR>
 <BR>
 <BR><FONT size=2>
<FONT color=#000000>vtkPolyData * CTPolyData = NULL; </FONT><BR>
<FONT color=#000000>vtkPolyData * MRPolyData = NULL; </FONT><BR>
<FONT color=#000000> </FONT><BR></FONT><FONT size=2>
<FONT color=#000000>CTPolyData = vtkPolyData::New();</FONT><BR>
<FONT color=#000000>CTPolyData->SetPoints(CTPoints);</FONT><BR>
<FONT color=#000000>MRPolyData = vtkPolyData::New(); </FONT><BR>
<FONT color=#000000>MRPolyData->SetPoints(MRPoints);</FONT><BR>
 <BR>
<FONT color=#000000>vtkIterativeClosestPointTransform * ICPTransfo = vtkIterativeClosestPointTransform::New();</FONT><BR>
<FONT color=#000000>vtkDataSet *source = NULL, *target = NULL;</FONT><BR>
<FONT color=#000000> </FONT><BR>
</FONT>
<P><FONT color=#000000><FONT size=2><BR></FONT><FONT size=2>ICPTransfo->GetLandmarkTransform()->SetModeToRigidBody();</FONT><FONT size=2>//SetModeToAffine();</P></FONT></FONT><FONT size=2>
<FONT color=#000000>ICPTransfo->StartByMatchingCentroidsOff();</FONT><BR>
<FONT color=#000000>ICPTransfo->SetMaximumMeanDistance(MaximumMeanDistance);</FONT><BR>
<FONT color=#000000>ICPTransfo->SetMaximumNumberOfIterations(MaxNumberOfIterations);</FONT><BR>
<FONT color=#000000> </FONT><BR>
</FONT>
<P><FONT color=#000000><FONT size=2><BR></FONT></FONT><FONT size=2><FONT color=#000000>vtkMaskPoints *maskPoints1 = vtkMaskPoints::New(); maskPoints1->SetInput(CTPolyData);</FONT></P>
<FONT color=#000000>vtkMaskPoints *maskPoints2 = vtkMaskPoints::New(); maskPoints2->SetInput(MRPolyData);</FONT><BR>
<FONT color=#000000></FONT><BR>
<FONT color=#000000>maskPoints1->SetMaximumNumberOfPoints(1000);</FONT><BR>
<FONT color=#000000>maskPoints1->GenerateVerticesOn();</FONT><BR>
<FONT color=#000000>maskPoints1->SetMaximumNumberOfPoints(1000);</FONT><BR>
<FONT color=#000000>maskPoints1->GenerateVerticesOn();</FONT><BR>
<FONT color=#000000>ICPTransfo->SetSource(maskPoints1);</FONT><BR>
<FONT color=#000000>ICPTransfo->SetTarget(maskPoints2);</FONT><BR>
 <BR>
</FONT><FONT color=#008000 size=2>/*ICPTransfo->SetSource((vtkPolyData*)maskPoints1);<BR>
ICPTransfo->SetTarget((vtkPolyData*)maskPoints2);*/<BR></FONT><FONT size=2>
</FONT><FONT color=#008000 size=2><FONT color=#000000>ICPTransfo->SetSource(maskPoints1->GetOutput());</FONT><BR>
<FONT color=#000000>ICPTransfo->SetTarget(maskPoints2->GetOutput());</FONT><BR>
<FONT color=#000000></FONT> <BR>
 <BR></FONT><FONT size=2>
</FONT><FONT size=2><FONT color=#000000>ICPTransfo->SetMeanDistanceModeToAbsoluteValue(); </FONT><BR>
 <BR>
</FONT><FONT color=#008000 size=2>// execution of ICP algorithm<BR></FONT><FONT size=2>
<FONT color=#000000>ICPTransfo->Modified();</FONT><BR>
<FONT color=#000000>ICPTransfo->Update();</FONT><BR>
 <BR>
</FONT><FONT color=#008000 size=2> <BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> <FONT color=#000000>MeanDistance = ICPTransfo->GetMeanDistance();</FONT><BR></FONT>
<FONT color=#000000> </FONT><BR>
<FONT color=#000000>Thank you for your help!!</FONT><BR>
 <BR><br /><hr /> <a href='' target='_new'></a></body>
</html>