I am reading uniform VTK grid in python. When I look at a piece of data in Paraview, I get the following (correct) image:

Then I visualize the slice using numpy and pylab using the following script:
import vtk from vtk.util.numpy_support import vtk_to_numpy import pylab imr=vtk.vtkXMLImageDataReader() imr.SetFileName('flow.vti') imr.Update() im=imr.GetOutput() nx,ny,nz=im.GetDimensions() orig=im.GetOrigin() extent=im.GetExtent() spacing=im.GetSpacing() flowVtk=im.GetPointData().GetArray("|flow|") flow=vtk_to_numpy(flowVtk).reshape(nx,ny,nz)

which seems incompatible. I tried resizing in reshape(...) , he did something, but he never showed the data that he should show.
Is there something clearly wrong?
EDIT: I also tried reshape((nx,ny,nz),order="F") (fortran ordering), and now I get a much better image (with a color map of the jets for better clarity)
, which is almost correct, but the data is suspiciously rotated 90 Β°, plus I would like to get some authoritative explanation, which orders to use and why (which one is used by VTK inside?).
EDIT2: to get the same view as in Paraview, I had to do pylab.imshow(np.rot90(flowZ0)) ; I donβt know why, so the question is still open:

source share