I'm struggling to export some 3D vector-arrays (numpy arrays) from python to a *.vtk-file for later use in ParaView.
I have three 3D MR-Velocimetry Images, each of 100x100x200 voxels containing the velocity components in x, y and z. What I want is to export this vector field to a *.vtk-file using the pyvtk-module from here.
Unfortunately I don't understand how it works :-(
What I tried so far:
from pyvtk import *
vectors = [flow['vx'], flow['vy'], flow['vz']]
dim=flow['vx'].shape
pointdata=PointData(Vectors([flow['vx'],flow['vy'],flow['vz']]))
vtk=VtkData(StructuredPoints(dim[0],dim[1],dim[2]), pointdata)
Where flow['...'] contains the vector-components. I got the following error:
ValueError: DataSet (size=100) and PointData (size=3) have different sizes
Yeeees, what is it trying to tell me? Ok, guess something like dimension mismatch, but how do I set up my input properly?
Any help would be appreciated. Thanks in advance