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:
PyVista Readers# Reader
File Extension(s)
Return Type(s)
.inp.tri.bmp.g.cgns.dem.dcm,.img.case.e,.ex2,.exii,.exo.facet.h5.cas.neu.cube.mr.gif.glb,.gltf.hdf,.vtkhdfImageData,MultiBlock,PartitionedDataSet,PolyData,UnstructuredGrid.hdr.jpeg,.jpg.mha,.mhd.res.mnc.nek5000.nii,.nii.gz.nhdr,.nrrd.obj.raw.pdb.p3d.ply.png.pnm.foam.vrt.pts.pvd.segy,.sgy.slc.stl.dat.tif,.tiff.vtkImageData,PolyData,RectilinearGrid,StructuredGrid,UnstructuredGrid.pvtkImageData,PolyData,RectilinearGrid,StructuredGrid,UnstructuredGrid.xdmfMultiBlock,RectilinearGrid,StructuredGrid,UnstructuredGrid.vti.vtm,.vtmb.vtpd.pvti.vtp.pvtr.pvtu.vtr.vts.vtu- Parameters:
- Returns:
pyvista.BaseReaderA subclass of
pyvista.BaseReaderis returned based on file type.
Examples
>>> import pyvista as pv >>> from pyvista import examples >>> from pathlib import Path >>> filename = examples.download_human(load=False) >>> Path(filename).name 'Human.vtp' >>> reader = pv.get_reader(filename) >>> reader XMLPolyDataReader('...Human.vtp') >>> mesh = reader.read() >>> mesh PolyData ... >>> mesh.plot(color='lightblue')