Conversion is possible with the DeepCopy() methods that were originally written to be used with C arrays. The ndarray.ravel() method returns a flattened view of the numpy array that can be used with DeepCopy:
import numpy as np
import vtk
m = vtk.vtkMatrix4x4()
# make some numpy arrays
a = np.random.rand(4,4)
b = np.zeros((4,4))
# copy from numpy to vtkMatrix4x4
m.DeepCopy(a.ravel())
# copy from vtkMatrix4x4 to numpy
m.DeepCopy(b.ravel(), m)
print(a)
print(b)
print(m)
This uses the Python sequence protocol rather than the Python buffer protocol. For a 16-element matrix, however, there can’t be a significant performance difference.
I don’t really do maintenance of the VTK numpy support code. But if somebody submits a patch, I’d be happy to review it.