Masking data of 4D images
6 views (last 30 days)
David Legland on 10 Oct 2019
I suppose that you want to repeat the binary mask along the missing dimension of your 4D data, right?
One possibility could be the following:
mask4d = repmat(mask, 1, 1, 1, size(data, 4));
values = data(mask4d);
(This assumes that the three dimensions of the mask correspond to the first three dimension of the data).