Dimensional transition in rotating turbulence