MS (Microstructure) function

This function takes in a 2-D or 3-D array of arbitrary size and returns
a microstructure of that same size.