#NEWLINE# def getNumpyFromVtk( dataObj , arrayName = 'Points' ) : #NEWLINE# #INDENT# if ( arrayName == 'Points' ) : #NEWLINE# #INDENT# vtkArray = dataObj . GetPoints ( ) . GetData ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# vtkArray = dataObj . GetPointData ( ) . GetArray ( arrayName ) #NEWLINE# #UNINDENT# if ( not vtkArray ) : #NEWLINE# #INDENT# raise KeyError ( 'Array not found' ) #NEWLINE# #UNINDENT# return numpy_support . vtk_to_numpy ( vtkArray )