febid.libraries.vtk_rendering.VTK_Rendering.numpy_to_vtk#

numpy_to_vtk(arr, cell_dim, data_name='scalar', grid=None, unstructured=False)[source]#

Convert numpy array to a VTK-datastructure (UniformGrid or UnstructuredGrid). If grid is provided, add new dataset to that grid.

Parameters:
  • arr – numpy array

  • cell_dim – array cell (cubic) edge length

  • data_name – name of data

  • grid – existing UniformGrid

  • unstructured – if True, return an UnstructuredGrid

Returns: