python - Check order of dimensions of a numpy ndarray -
i have 3d volume , want order of dimensions in memory this:
x changes fastest, y, z so if volume dimensions (depth, height, width) first width elements should first row of first slice. followed width elements of second row of first slice, third row of first slice... go on height rows first slice. process repeat again depth slices.
to give concrete example, let's have following data 3x3 volume.
slice 0:
[ 1, 2, 3 ] [ 4, 5, 6 ] [ 7, 8, 9 ] slice 1:
[ 10, 11, 12 ] [ 13, 14, 15 ] [ 16, 17, 18 ] slice 2:
[ 19, 20, 21 ] [ 22, 23, 24 ] [ 25, 26, 27 ] then want in memory data like:
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ... 27 ]
how should check if data ordered this, , if isn't how should order it?
Comments
Post a Comment