VTKDataSetReader#

class VTKDataSetReader(*args, **kwargs)[source]#

VTK Data Set Reader for .vtk files.

Wraps vtkDataSetReader.

Notes#

This reader calls ReadAllScalarsOn, ReadAllColorScalarsOn, ReadAllNormalsOn, ReadAllTCoordsOn, ReadAllVectorsOn, and ReadAllFieldsOn on the underlying vtkDataSetReader.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> from pyvista import examples
>>> from pathlib import Path
>>> filename = examples.download_brain(load=False)
>>> Path(filename).name
'brain.vtk'
>>> reader = pv.get_reader(filename)
>>> mesh = reader.read()
>>> sliced_mesh = mesh.slice('x')
>>> sliced_mesh.plot(cpos='yz', show_scalar_bar=False)
../../../_images/pyvista-VTKDataSetReader-701c8ae5a0de436c_00_00.png

Inheritance#

Inherited members are documented on BaseReader, _FileIOBase.

See them all under Inherited Attributes and Inherited Methods.

Inherited Attributes#

_FileIOBase.extension_patterns

Return mapping from regex pattern matching associated with this class.

_FileIOBase.extensions

Return the file extensions associated with this class.

BaseReader.path

Return or set the filename or directory of the reader.

BaseReader.reader

Return the vtk Reader object.

Inherited Methods#

BaseReader.hide_progress

Hide the progress bar when loading the file.

BaseReader.read

Read data in file.

BaseReader.show_progress

Show a progress bar when loading the file.