<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi all,<br>
<br>
I am new to vtk and I was hoping on some help with some questions I
have regarding <br>
the PCAAnalysisFilter. What I am trying to build is an executable that
will take as a <br>
parameter an OBJ 3D file and it will result the PCA eigenvalues and
vectors.<br>
<br>
Unfortunately, I am not sure about how to pass the point data from the
vtkOBJReader<br>
to the PCAAnalysisFilter. Here is the code in C++ I am working on but
for some<br>
reason I get no results as the during the runtime I get an error on the
<big><tt><small>vtkProcrustesAlignmentFilter<br>
</small></tt></big>which I cannot see what it is as the vtkOutputwindow
pops up and disappears instantly.<br>
<br>
<big><tt><small>vtkOBJReader *importer = vtkOBJReader::New();<br>
   importer-&gt;SetFileName("atest.obj");<br>
   importer-&gt;Update();<br>
<br>
// convert polygonal mesh into triangle mesh<br>
   vtkTriangleFilter *tri = vtkTriangleFilter::New();<br>
   tri-&gt;SetInput(importer-&gt;GetOutput());<br>
   tri-&gt;Update();<br>
<br>
<big>  </big> vtkProcrustesAlignmentFilter *gls =
vtkProcrustesAlignmentFilter::New();<br>
   gls-&gt;GetLandmarkTransform()-&gt;SetModeToRigidBody();<br>
   gls-&gt;SetNumberOfInputs(1);<br>
   gls-&gt;SetInput(1,tri-&gt;GetOutput());<br>
   gls-&gt;Update();<br>
<big><br>
</big>   vtkPCAAnalysisFilter *pca = vtkPCAAnalysisFilter::New();<br>
   pca-&gt;SetNumberOfInputs(1);<br>
   pca-&gt;SetInput(1,gls-&gt;GetOutput()); <br>
   pca-&gt;Update();   <br>
   pca -&gt; PrintSelf(cout, 0);<br>
   <br>
   cout &lt;&lt; endl &lt;&lt; "eigenvalues:";<br>
   int inputs = pca-&gt;GetEvals()-&gt;GetNumberOfTuples();<br>
   for (int i = 0; i &lt; inputs; i++)<br>
    cout &lt;&lt; " " &lt;&lt; pca-&gt;GetEvals()-&gt;GetValue(i);<br>
   <br>
   cout &lt;&lt; endl;<br>
<br>
So, how is it possible to get the error message on a cout command <br>
and how am I supposed to feed the vertices to the
procrustersalignmentfilter<br>
and on the pcaanalysisfilter.<br>
<br>
Cheers<br>
</small></tt></big>
</body>
</html>