Dear,
I am working in python. I am very confused about the index ordering in the matrix I do pass to imdata.
I do have a numpy array named matrix
, with indexes [x,y,z] that I pass to a vtkImageData
with:
imdata = vtk.vtkImageData()
depthArray = numpy_support.numpy_to_vtk(
matrix.ravel(), deep=True,
array_type=numpy_support.get_vtk_array_type(matriz.dtype)
)
imdata.SetDimensions( matrix.shape[0],matrix.shape[1],matrix.shape[2])
imdata.SetSpacing(1,1,1)
imdata.GetPointData().SetScalars(depthArray)
but when I plot it, it looks rotated in space. I guess the ordering [x,y,z] in the matrix is not correct. Is it ok?
Is x,y,z the correct index order for other functions?
Regards,
Daniel