<!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->SetFileName("atest.obj");<br>
importer->Update();<br>
<br>
// convert polygonal mesh into triangle mesh<br>
vtkTriangleFilter *tri = vtkTriangleFilter::New();<br>
tri->SetInput(importer->GetOutput());<br>
tri->Update();<br>
<br>
<big> </big> vtkProcrustesAlignmentFilter *gls =
vtkProcrustesAlignmentFilter::New();<br>
gls->GetLandmarkTransform()->SetModeToRigidBody();<br>
gls->SetNumberOfInputs(1);<br>
gls->SetInput(1,tri->GetOutput());<br>
gls->Update();<br>
<big><br>
</big> vtkPCAAnalysisFilter *pca = vtkPCAAnalysisFilter::New();<br>
pca->SetNumberOfInputs(1);<br>
pca->SetInput(1,gls->GetOutput()); <br>
pca->Update(); <br>
pca -> PrintSelf(cout, 0);<br>
<br>
cout << endl << "eigenvalues:";<br>
int inputs = pca->GetEvals()->GetNumberOfTuples();<br>
for (int i = 0; i < inputs; i++)<br>
cout << " " << pca->GetEvals()->GetValue(i);<br>
<br>
cout << 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>