Added 1D<->3D index conversions