[vtkusers] Re ading a .vtp

igorznt igorznt at gmail.com
Wed May 26 17:44:22 EDT 2010


I use this for reading .vtp files:
        reader = vtk.vtkXMLPolyDataReader()
        path = os.path.join(constant.BASE_DIR, "archive.vtp") #Archive path
        reader.SetFileName(path)
        reader.Update()        
        
        mapper = vtk.vtkPolyDataMapper()
        mapper.SetInput(reader.GetOutput())

        actor = vtk.vtkActor()
        actor.SetMapper(mapper)



mariagrazia.madaschi wrote:
> 
> Hi,
> I really know very little about vtk. Maybe my answer could be a bit stupid
> to many of you.
> I've got a problem to resolve. I create a file .vtp with many cells of
> kidney. This cells are obviously composed of many points. I need to
> calculate the centroid of every cells and to do this I need all points
> coordinates of every cells.
> I know that .vtp contain the information I need, but I really don't know
> how to get it.
> (I usually use Python as language)
> 
> Can someone help me?
> 
> Thanks.
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-- 
View this message in context: http://old.nabble.com/Reading-a-.vtp-tp28609218p28686877.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list