[vtkusers] read a vtp
mariagrazia.madaschi at unibg.it
mariagrazia.madaschi at unibg.it
Tue May 25 10:31:37 EDT 2010
I have to read a .vtp file to obtain points coordinates. I tried to use
the script below, but the result isn't right. Even if I write
reader.GetNumberOfPoint, instead of reader.GetOutput, the result is 0, but
is not true, because if I read the file with excel, number of points is
404442.
Where is the mistake in my script?
Is there any way to read points coordinates from a .vtp file?
(My problem is: I created a vtp with a group of kidney cells; every cells
is composed of many points. I need points coordinates to calculate the
centroid of every cells that I will use to build Voronoi diagram.)
import vtk
filename= "nuclei_1.vtp"
reader = vtk.vtkXMLPolyDataReader()
reader.SetFileName (filename)
polyDataOutput = reader.GetOutput()
print polyDataOutput
More information about the vtkusers
mailing list