using vtkPCAAnalysisFilter for eigen vectors

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using vtkPCAAnalysisFilter for eigen vectors

Syed Amjad
Hi,

I'm having troble using vtkPcaanalysisfilter....

I'm following the usual method.. setnumberofinputs.. then setinput then updata etc.. but I don't get the desired output.

vtkPoints *points.... is my data.

I have a set of data of 336 points... (vtkPoints).. just one set.. so I guess that the setnumberofinputs will be only 1. then my setinput is setinput(0, points).... then I do an update... This doesn't work..  really

here's the code:

*/    //set input for pca

    vtkPolyData *pointset=vtkPolyData::New();
    pointset->SetPoints(points);

    pointset->Update();

    pca->SetNumberOfInputs(1);
    pca->SetInput(0,pointset);

//execute pca
    pca->Update();
    cout<<"eigen values: ";

    numPoints=pca->GetEvals()->GetNumberOfTuples();

    for(i=0;i<1;i++)
        cout<<" "<<pca->GetEvals()->GetValue(i);


All I want to know is how I get the filter to work on these points so that I can get the eigen values AND the eigen vectors..

right now I get a nonsense value..

thankyou,

Majeed

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: using vtkPCAAnalysisFilter for eigen vectors

Rasmus Reinhold Paulsen
hi!

On Fri, 3 Feb 2006, Syed Amjad wrote:

> I'm having troble using vtkPcaanalysisfilter....

The PCA analysis is a somewhat specialised filter developed to be used
together with the Procrustes class also in VTK. It is not a "general" PCA
method that can be used on arbitrary matrices. It requires a set (not only
one) aligned datasets to work. I suggest reading the class documentation.
Furthermor, read Cootes' online report if you plan to use it for
statistical shape analysis.

Best regards,
Rasmus


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers