convert_array

convert_array(arr, name=None, deep=False, array_type=None)

Convert a NumPy array to a vtkDataArray or vice versa.

Parameters
arrnp.ndarray or vtkDataArray

A numpy array or vtkDataArry to convert.

namestr, optional

The name of the data array for VTK.

deepbool, optional

If input is numpy array then deep copy values.

array_typeint, optional

VTK array type ID as specified in specified in vtkType.h.

Returns
vtkDataArray, numpy.ndarray, or DataFrame

The converted array. If input is a numpy.ndarray then returns vtkDataArray or is input is vtkDataArray then returns NumPy ndarray.