Fix permuting of array dimensions
Previous state assumed a different ordering of the dimensions of the input array than what it actually had. For swap-axis flag this led to striding errors. The original array is in (x,z,y) format, while the final is in (z,y,x).
Fixes #5 (closed)