General Utilities

utilities.VtkErrorCatcher([raise_errors, ...])

Context manager to temporarily catch VTK errors.

utilities.set_error_output_file(filename)

Set a file to write out the VTK errors.

utilities.is_inside_bounds(point, bounds)

Check if a point is inside a set of bounds.

Object Conversions

wrap(dataset)

Wrap any given VTK data object to its appropriate PyVista data object.

is_pyvista_dataset(obj)

Return True if the object is a PyVista wrapped dataset.

image_to_texture(image)

Convert vtkImageData (pyvista.UniformGrid) to a vtkTexture.

numpy_to_texture(image)

Convert a NumPy image array to a vtk.vtkTexture.

array_from_vtkmatrix(matrix)

Convert a vtk matrix to an array.

vtkmatrix_from_array(array)

Convert a numpy.ndarray or array-like to a vtk matrix.

cubemap([path, prefix, ext])

Construct a cubemap from 6 images.

File IO

read(filename[, attrs, force_ext, file_format])

Read any file type supported by vtk or meshio.

read_exodus(filename[, animate_mode_shapes, ...])

Read an ExodusII file ('.e' or '.exo').

read_texture(filename[, attrs])

Load a texture from an image file.

read_legacy(filename)

Use VTK's legacy reader to read a file.

save_meshio(filename, mesh[, file_format])

Save mesh to file using meshio.

Mesh Creation

lines_from_points(points[, close])

Make a connected line set given an array of points.

vtk_points(points[, deep])

Convert numpy array or array-like to a vtkPoints object.

vector_poly_data(orig, vec)

Create a pyvista.PolyData object composed of vectors.

fit_plane_to_points(points[, return_meta])

Fit a plane to a set of points using the SVD algorithm.

Array Access

get_array(mesh, name[, preference, err])

Search point, cell and field data for an array.

convert_array(arr[, name, deep, array_type])

Convert a NumPy array to a vtkDataArray or vice versa.

point_array(obj, name)

Return point array of a pyvista or vtk object.

cell_array(obj, name)

Return cell array of a pyvista or vtk object.

field_array(obj, name)

Return field data of a pyvista or vtk object.

Image Comparison and Regression

compare_images(im1, im2[, threshold, use_vtk])

Compare two different images of the same size.

Miscellaneous

start_xvfb([wait, window_size])

Start the virtual framebuffer Xvfb.