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.dat.dcm.dem.facet.foam.g.gif.glb.gltf.hdf.img.inp.jpg.jpeg.hdr.mha.mhd.nii.nii.gz.nhdr.nrrd.obj.p3d.ply.png.pnm.pts.pvd.pvti.pvtk.pvtr.pvtu.res.segy.sgy.slc.stl.tif.tiff.tri.vti.vtk.vtm.vtmb.vtp.vtr.vts.vtu.xdmf.vtpd- Parameters:
- Returns:
pyvista.BaseReaderA subclass of
pyvista.BaseReaderis 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')