Rotating 3-D arrays in Python became much more straightforward with Numpy ≥ 1.12. For this example, assume
data.shape == (256,128,128)
rot90 Numpy ≥ 1.12
numpy.flip has also been upgraded to N-dimensional arrays, similarly avoiding the awkward transpose above.
OBSOLETE, awkward 3-D rotate Numpy < 1.12
This is the equivalent of the new
numpy.rot90 syntax above