overloaded GetIndex with argument to override shape
using flat data buffer array