0001 function B = vb_neighbor_smooth_3d(B)
0002
0003
0004
0005
0006
0007
0008
0009 [N1,N2,N3] = size(B);
0010
0011
0012
0013 step = 2;
0014
0015
0016
0017 j1d = 1:(N1-1);
0018 j1u = 2:N1;
0019
0020 j2d = 1:(N2-1);
0021 j2u = 2:N2;
0022
0023
0024 for zz = 1:N3
0025 B(j1d, : , zz ) = B(j1d, : , zz ) + B(j1u, : , zz );
0026 end
0027
0028 for zz = 1:N3
0029 B( : ,j2d, zz ) = B( : ,j2d, zz ) + B( : ,j2u, zz );
0030 end
0031
0032 for zz = 1:(N3-1)
0033 B(:,:,zz) = B(:,:,zz) + B(:,:,zz+1);
0034 end
0035
0036 B = B/8;
0037
0038