Hi, I want to reduce the size of a 3D image by averaging the values in 3D. For example if the image is 160*216*176. I wrote the code below to process the image to average the values in every 4*4*4 cube thereby creating a new matrix that is 40*54*44 in size.my code is below
X(1:40)=4;Y(1:54)=4;Z(1:44)=4;A=mat2cell(imagestack_1,[X],[Y],[Z]);average=cellfun(@mean2,A);
But this shows an error
Error using mat2cell (line 97)Input arguments, D1 through D3, must sum to each dimension of the input matrix size, [160 216 176].'
Anyone who knows Please guide me!!
Best Answer