<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hi,<BR>
&nbsp;<BR>
&nbsp;&nbsp; I&nbsp; 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&nbsp;I get when executing: <BR>
&nbsp;<BR>
&nbsp;<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>
&nbsp;<BR>
and here is the code I use:<BR>
&nbsp;<BR>
&nbsp;<BR><FONT size=2>
<FONT color=#000000>vtkPolyData * CTPolyData = NULL; </FONT><BR>
<FONT color=#000000>vtkPolyData * MRPolyData = NULL; </FONT><BR>
<FONT color=#000000>&nbsp;</FONT><BR></FONT><FONT size=2>
<FONT color=#000000>CTPolyData = vtkPolyData::New();</FONT><BR>
<FONT color=#000000>CTPolyData-&gt;SetPoints(CTPoints);</FONT><BR>
<FONT color=#000000>MRPolyData = vtkPolyData::New(); </FONT><BR>
<FONT color=#000000>MRPolyData-&gt;SetPoints(MRPoints);</FONT><BR>
&nbsp;<BR>
<FONT color=#000000>vtkIterativeClosestPointTransform * ICPTransfo = vtkIterativeClosestPointTransform::New();</FONT><BR>
<FONT color=#000000>vtkDataSet *source = NULL, *target = NULL;</FONT><BR>
<FONT color=#000000>&nbsp;</FONT><BR>
</FONT>
<P><FONT color=#000000><FONT size=2><BR></FONT><FONT size=2>ICPTransfo-&gt;GetLandmarkTransform()-&gt;SetModeToRigidBody();</FONT><FONT size=2>//SetModeToAffine();</P></FONT></FONT><FONT size=2>
<FONT color=#000000>ICPTransfo-&gt;StartByMatchingCentroidsOff();</FONT><BR>
<FONT color=#000000>ICPTransfo-&gt;SetMaximumMeanDistance(MaximumMeanDistance);</FONT><BR>
<FONT color=#000000>ICPTransfo-&gt;SetMaximumNumberOfIterations(MaxNumberOfIterations);</FONT><BR>
<FONT color=#000000>&nbsp;</FONT><BR>
</FONT>
<P><FONT color=#000000><FONT size=2><BR></FONT></FONT><FONT size=2><FONT color=#000000>vtkMaskPoints *maskPoints1 = vtkMaskPoints::New(); maskPoints1-&gt;SetInput(CTPolyData);</FONT></P>
<FONT color=#000000>vtkMaskPoints *maskPoints2 = vtkMaskPoints::New(); maskPoints2-&gt;SetInput(MRPolyData);</FONT><BR>
<FONT color=#000000></FONT><BR>
<FONT color=#000000>maskPoints1-&gt;SetMaximumNumberOfPoints(1000);</FONT><BR>
<FONT color=#000000>maskPoints1-&gt;GenerateVerticesOn();</FONT><BR>
<FONT color=#000000>maskPoints1-&gt;SetMaximumNumberOfPoints(1000);</FONT><BR>
<FONT color=#000000>maskPoints1-&gt;GenerateVerticesOn();</FONT><BR>
<FONT color=#000000>ICPTransfo-&gt;SetSource(maskPoints1);</FONT><BR>
<FONT color=#000000>ICPTransfo-&gt;SetTarget(maskPoints2);</FONT><BR>
&nbsp;<BR>
</FONT><FONT color=#008000 size=2>/*ICPTransfo-&gt;SetSource((vtkPolyData*)maskPoints1);<BR>
ICPTransfo-&gt;SetTarget((vtkPolyData*)maskPoints2);*/<BR></FONT><FONT size=2>
</FONT><FONT color=#008000 size=2><FONT color=#000000>ICPTransfo-&gt;SetSource(maskPoints1-&gt;GetOutput());</FONT><BR>
<FONT color=#000000>ICPTransfo-&gt;SetTarget(maskPoints2-&gt;GetOutput());</FONT><BR>
<FONT color=#000000></FONT>&nbsp;<BR>
&nbsp;<BR></FONT><FONT size=2>
</FONT><FONT size=2><FONT color=#000000>ICPTransfo-&gt;SetMeanDistanceModeToAbsoluteValue(); </FONT><BR>
&nbsp;<BR>
</FONT><FONT color=#008000 size=2>// execution of ICP algorithm<BR></FONT><FONT size=2>
<FONT color=#000000>ICPTransfo-&gt;Modified();</FONT><BR>
<FONT color=#000000>ICPTransfo-&gt;Update();</FONT><BR>
&nbsp;<BR>
</FONT><FONT color=#008000 size=2>&nbsp;<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> <FONT color=#000000>MeanDistance = ICPTransfo-&gt;GetMeanDistance();</FONT><BR></FONT>
<FONT color=#000000>&nbsp;</FONT><BR>
<FONT color=#000000>Thank you for your help!!</FONT><BR>
&nbsp;<BR><br /><hr /> <a href='' target='_new'></a></body>
</html>