Convert a File from LegacyVTK to VTI: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(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 ...")
 
(Replaced content with "{{ParaView/Template/DeprecatedUsersGuide}} {{ParaView/Template/Footer}}")
Tag: Replaced
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
This program can be run with the [[ParaView/Python_Scripting|pvpython]] executable that is distributed with ParaView
{{ParaView/Template/DeprecatedUsersGuide}}


<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/Template/Footer}}
{{ParaView/Template/Footer}}

Latest revision as of 18:45, 24 June 2024

PAGE DELETED
The Paraview's User Guide and Reference Manual have been moved from the Wiki to The ParaView Guide. Please use the history if you want to access the old version of this document.



ParaView: [Welcome | Site Map]