What is the fastest way of calculating the maximum value, with it's corresponding index, of each 'slice' of a 3D array?