How to Convert 4D-Single to MxNXN

3 views (last 30 days)
mohd akmal masud
mohd akmal masud on 30 Jun 2022
Dear all,
I have 100 set data 4D-Single. anyone know how to convert it to MxNxN?
Letsay my 4D-Single is cropVol, want to convert to g (see the picture in workspace)
  21 Comments
Rik
Rik on 1 Jul 2022
Do any of those numbers mean something to you? Do you expect 4 of something? Is your detector 176 by 224?
Without knowing what your dimensions actually mean it is not possible to help you reduce the dimension count to 3.
To explore, you could use the volume viewer on cropVol(:,:,:,k) (putting each of the 4 in a subplot). I don't know if that will help at all, since you're being very sparse with explanations.
Bjorn Gustavsson
Bjorn Gustavsson on 1 Jul 2022
When the 4-D array-size is [176 224 152 4] the only way to put your 4-D array into an N-by-N-by-M array, as you requested is to put the elements into an 128-by-128-by-1463 array. You can do that by something like:
A3D = reshape(cropVol,[128 128 1463]);
If you want or need to re-arrange the for dimensions (of still unknown meaning to us since you still will not tell us what they signify.) you can do that with the permute function. This is the only way to put all elements of an array with dimensions [176 224 152 4] into an N-by-N-by-M array, since the total number of elements factor into: 2^14 * 7 * 11 * 19.

Sign in to comment.

Answers (0)

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!