python_view Module

python_view is a module providing access to a PythonView. It is possible to use the PythonView API directly, but this module provides convenience classes in Python.

paraview.python_view.call_render(render_function, view, width, height)[source]

Utility function to call the user-defined render function. This is called by the C++ side of the vtkPythonView class.

view

vtkPythonView object

width

Width of view

height

Height of view

paraview.python_view.figure_to_data(figure)[source]

Convert a Matplotlib figure to a numpy 2D array with RGBA uint8 channels and return it.

figure

A matplotlib figure.

return

A numpy 2D array of RGBA values.

paraview.python_view.figure_to_image(figure)[source]

Convert a Matplotlib figure to a vtkImageData with RGBA unsigned char channels.

figure

A matplotlib figure.

return

A vtkImageData with the Matplotlib figure content.

paraview.python_view.matplotlib_figure(width, height)[source]

Create a Matplotlib figure with specified width and height for rendering.

w

Width of desired plot.

h

Height of desired plot.

return

A Matplotlib figure.

paraview.python_view.numpy_to_image(numpy_array)[source]

Convert a numpy 2D or 3D array to a vtkImageData object.

numpy_array

2D or 3D numpy array containing image data

return

vtkImageData with the numpy_array content