Convert a File from LegacyVTK to VTI

From KitwarePublic
Revision as of 16:15, 17 August 2012 by Hal Canary (talk | contribs) (Created page with "This program can be run with the pvpython executable that is distributed with ParaView <source lang="python"> import sys import paraview.vtk.io as ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This program can be run with the pvpython executable that is distributed with ParaView

<source lang="python"> import sys import paraview.vtk.io as vtk_io if len(sys.argv) < 2: print "Useage\n\tpvpython vtk2vti.py FILE.vtk [more FILES.vtk...]\n" for arg in sys.argv[1:]: reader = vtk_io.vtkStructuredPointsReader() reader.SetFileName(arg) writer = vtk_io.vtkXMLImageDataWriter() writer.SetInputConnection(reader.GetOutputPort()) output_filename = arg + ".vti" writer.SetFileName(output_filename) writer.Write() print "wrote to \"%s\"" % output_filename </source> back to ParaView/PythonRecipes.


ParaView: [Welcome | Site Map]