.vti visualization in python

115 Views Asked by At

Is there some way to visualize data from .vti file as a volume not using ParaView, but using just python?

And if there is, is there a way to connect it with some .stl file?

The ideal solution would be to have the same output as from ParaView but using only python.

2

There are 2 best solutions below

0
Nico Vuaille On

ParaView has a python wrapping https://docs.paraview.org/en/latest/UsersGuide/introduction.html#getting-started-with-pvpython.

Your file is a VTK file, so you can also use the VTK python module https://pypi.org/project/vtk/.

Also you can use pyvista, a user friendly wrapper around VTK https://docs.pyvista.org/version/stable/index.html

0
Bane Sullivan On

PyVista will be your best friend here ;)

import pyvista as pv

volume = pv.read("file.vti")

volume.plot()

Please see PyVista's documentation for different ways to visualize this data: https://docs.pyvista.org/version/stable/