How do I load this (Images with ID)


Hi Experts,

I have a set (1Million) of 2D grayscale images (1K by 1K). Each has an ID.
I would like to build a 3D array with the dimensions X,Y and ID, where X,Y are the 2 dimensions of the picture.

The question is how do I load this thing?

If I follow the load->redimension approach as in the manual, I will need to build a long long list like:
X1, Y1, ID1, VALUE1
X1, Y2, ID1, VALUE2
X2, Y1, ID1, VALUE3

This way the data is 75% duplication and I’m sure this is not the most efficient way to do this.
Is there a way I can load directly to the 3D array?