2 years ago

#6185

test-img

Bill_BIlliams

Reading .VTS Files in Mayavi/ Python Scripting

I'm new to python and have a structured grid vtk file (.VTS) that I would like to open in a python script (visual studio code) to run in mayavi. I've been reading elsewhere you need a XML data reader to load the source data? What's the easiest way to open this in mayavi and begin to manipulate the data.

I've installed mayavi to my virtual environment, but wondering if I need other packages.

Any information or recommendation for articles to read/things to try would be greatly appreciated!

Information from the VTS file header

<?xml version="1.0"?>
<VTKFile type="StructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
<StructuredGrid WholeExtent="0 72 0 1023 0 255">
<Piece Extent="0 72 0 1023 0 255">
<Points>
<DataArray Name="points" NumberOfComponents="3" type="Float64" format="appended" offset="0"/>
</Points>
<PointData Scalars="gpr data">
<DataArray Name="gpr data" NumberOfComponents="1" type="Float64" format="appended" offset="459276296"/>
</PointData>
</Piece>
</StructuredGrid>
<AppendedData encoding="raw">

python

3d

vtk

mayavi

mayavi.mlab

0 Answers

Your Answer

Accepted video resources