How can I partition elements of an (n x m x t) list into blocks of (n x m) using positions in the (t) dimension as reference? In other words, I would like all [[All,All,1]] elements to be grouped together in one block, and so on for all elements in (t).
For example, if I have the following list where n=4, m=4 and t=5:
list1 = {{{1,2,3,4,5},{6,7,8,9,10}},{{11,12,13,14,15},{16,17,18,19,20}}}
How can I transform it to obtain the following result?
list2 = {{{{1,6},{11,16}}},{{{2,7},{12,17}}},{{{3,8},{13,18}}},{{{4,9},{14,19}}},{{{5,10},{15,20}}}}
More details on what I would like to do:
The reason I am asking is because I would like to perform a multidimensional Fourier transform on list1, starting with a 1D Fourier transform in the (t) dimension, followed by a 2D Fourier transform in the (n x m) dimension.
I would like to first perform the 1D Fourier transform on list1 in the following way:
fourierList1 = Map[Fourier, list1, {2}]
Such that:
fourierList1 = {{Fourier[{a,b,c,d,e}],Fourier[{f,g,h,i,j}}],{Fourier[{k,l,m,n,o}],Fourier[{p,q,r,s,t}]}}
Suppose that the result is:
fourierList1 = {{{1,2,3,4,5},{6,7,8,9,10}},{{11,12,13,14,15},{16,17,18,19,20}}}
Then I would like to transform fourierList1 by grouping elements in the way described above and obtain another list called fourierList2.
fourierList2 = {{{{1,6},{11,16}}},{{{2,7},{12,17}}},{{{3,8},{13,18}}},{{{4,9},{14,19}}},{{{5,10},{15,20}}}}
Then I would like to map a 2D Fourier transform on fourierList2:
fourierList3 = Map[Fourier, fourierList2 , {2}]
And finally, transform fourierList3 back into the original (n x m x t) list format.