Luis
Luis

Reputation: 159

Orienting VTK PolyData objects in the same direction

I have different objects coming from DICOM files (isolated bones) loaded with vtk as meshes (vtkPolyData). Each one has a different orientation and I'm trying to rotate them at the appropriate angles so that all of them share the same maximum variance direction (that I expect to be the longest dimension of the bone). The idea is like ordering the bones parallelly. I was thinking in getting the maximum variance direction with PCA or a similar technique and rotating the bone at the corresponding degrees to match a particular direction (for example Z-axis). I have no idea how to compute the maximum variance direction of a vtkPolyData object. Any idea?. Could I extract this information from the Cell Data Normals? Any other proposal to re-orient the bones?

Any suggestion will be highly appreciated. Thanks a lot.

Upvotes: 0

Views: 416

Answers (1)

Luis
Luis

Reputation: 159

Found this but it's extremely resource-demanding for high resolutions meshes:

https://kitware.github.io/vtk-examples/site/Python/PolyData/AlignTwoPolyDatas/

But I can do the job if no alternatives are found.

Upvotes: 0

Related Questions