pyvista.get_reader#
- get_reader(filename, force_ext=None)[source]#
Get a reader for fine-grained control of reading data files.
Supported file types and Readers:
File Extension
Class
.bmp
.cas
.case
.cgns
.cube
.dat
.dcm
.dem
.e
.exo
.exii
.ex2
.facet
.foam
.g
.gif
.glb
.gltf
.hdf
.img
.inp
.jpg
.jpeg
.hdr
.mha
.mhd
.nek5000
.nii
.nii.gz
.nhdr
.nrrd
.obj
.p3d
.ply
.png
.pnm
.pts
.pvd
.pvti
.pvtk
.pvtr
.pvtu
.res
.segy
.sgy
.slc
.stl
.tif
.tiff
.tri
.vrt
.vti
.vtk
.vtkhdf
.vtm
.vtmb
.vtp
.vtr
.vts
.vtu
.xdmf
.vtpd
- Parameters:
- Returns:
pyvista.BaseReader
A subclass of
pyvista.BaseReader
is returned based on file type.
Examples
>>> import pyvista as pv >>> from pyvista import examples >>> filename = examples.download_human(load=False) >>> filename.split('/')[-1] # omit the path 'Human.vtp' >>> reader = pv.get_reader(filename) >>> reader XMLPolyDataReader('.../Human.vtp') >>> mesh = reader.read() >>> mesh PolyData ... >>> mesh.plot(color='lightblue')