You can use a vector with n number of data feilds how would you flatten it. you can use any programming languange
There is a flatten function used in deep learning generally used to flatten the image into 28X28 matrix or vector. The module is found in the tensorflow you can check for it.