[vtkusers] PCA on vtkImageData

Andrew Crozier andrew.crozier at medunigraz.at
Mon Nov 17 10:28:52 EST 2014


Hi,

I am trying to evaluate the principal components of a strucutre in a 3D 
volume image, to determine its spatial alignment for use in an automatic 
processing pipeline.

The input is a vtkImageData, with multiple integer values (say, 0, 1, 2 
and 3), and I want to perform PCA on the positions of all voxels with 
value 2, for example.

I have looked at vtkPCAAnalysisFilter, and this requires an input of 
vtkPointSet. vtkImageDataToPointSet converts a vtkImageData to a 
vtkStructuredGrid, however I expect this to include all points in the 
original image. At the moment I seem to be missing some way of filtering 
out the points other than those of value 2.

Any help provided for this would be greatly appreciated!

Best wishes,
Andrew Crozier

Medical University of Graz


More information about the vtkusers mailing list