matlab - mat2cell to divide 3D image into blocks -
i have 4d image of size 60 x 80 x 12 x 350
, i.e. 3d image each voxel has time series (of 350).
now want use mat2cell
divide 3d image cubes of dimension k*k*k
. each voxel in cube vector of size 350 (the time series).
i think mat2cell
don't know how exactly. each cell should contain in end 3d block of image each voxel of block vector of size 350.
assuming 4d matrix called m
. need have vectors elements sum size(m, i)
i = 1:4
. assuming k
has value, tried both 4 (because it's common factor of sizes specified) , 3 (because it's not).
k = 3; mprime = mat2cell(m, ... [k*ones(1, floor(size(m,1)/k)), mod(size(m,1), k)], ... [k*ones(1, floor(size(m,2)/k)), mod(size(m,2), k)], ... [k*ones(1, floor(size(m,3)/k)), mod(size(m,3), k)], ... ones(1, size(m,4)));
Comments
Post a Comment