<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>converting from vtkPoints to itkPointSet</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hello,<BR>
<BR>
Ive been trying to converting from vtkPoint to itkPointSet i order to use a pointset registration algorithm.<BR>
<BR>
im using VC2003 and i get the 0xc000005 error code, besides i know that the problem is when i called itkPS->SetPoints(itkPContainer);<BR>
<BR>
im aware of the vtkFloatingPointType be defined as double. I had read the vtk2itkDouble.cxx and vtk2itk.cxx and using that type of coding still gets me error.<BR>
<BR>
Here is my code (i know its not the same as vtk2itkDouble.cxx or vtk2itk.cxx)i think it should work. if i missed something i would appreciate that you can tell me.<BR>
<BR>
itk::PointSet< double, 3 >::Pointer vtkPoints2itkPointSet(vtkPoints* vtkPS)<BR>
{<BR>
typedef itk::PointSet< double, 3 > PointSetType;<BR>
PointSetType::Pointer itkPS;<BR>
<BR>
typedef PointSetType::PointType PointType;<BR>
PointType itkP;<BR>
<BR>
typedef PointSetType::PointsContainer PointsContainer;<BR>
PointsContainer::Pointer itkPContainer = PointsContainer::New();<BR>
<BR>
itkPContainer->Reserve(vtkPS->GetNumberOfPoints());<BR>
<BR>
unsigned int i;<BR>
double* tmp;<BR>
<BR>
for(i=0;i<vtkPS->GetNumberOfPoints();i++)<BR>
{<BR>
tmp=vtkPS->GetPoint(i);<BR>
<BR>
itkP[0]=tmp[0];<BR>
itkP[1]=tmp[1];<BR>
itkP[2]=tmp[2];<BR>
itkPContainer->InsertElement( i, itkP ); <BR>
<BR>
}<BR>
<BR>
itkPS->SetPoints(itkPContainer);<BR>
<BR>
return itkPS;<BR>
}</FONT>
</P>
</BODY>
</HTML>