Commit 9fa166d9 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Update IPTS-21442/vts_to_vti.py

parent e5f04839
import glob
from paraview.simple import *
filenames = glob.glob('*.vts')
for filename in filenames:
vts = XMLStructuredGridReader(FileName=[filename])
Show(vts) # So it actually loads the data
_, x, _, y, _, z = vts.GetDataInformation().DataInformation.GetExtent()
print(x,y,z)
resampleToImage = ResampleToImage(Input=vts)
resampleToImage.SamplingDimensions = [x, y, z]
SaveData(filename.replace('vts','vti'), proxy=resampleToImage)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment