% create gaussian kernel with size 2 (in voxels!) % values in the kernel smaller than 1e-4 are discarded % as they don't play any big role for the sum of weights k = smoothkern(2, 1e-4); % a VTC is loaded (datatype: uint16) vtc = xff('*.vtc'); % the data is smoothed in dims 2 through 4 -> store as single! vtc.VTCData = single(flexinterpn(vtc.VTCData, ... [Inf, Inf, Inf, Inf; ones(2, 4); size(vtc.VTCData)], ... {[0; 1; 0], k, k, k}, {1, 1, 1, 1}, 0)); % some patches necessary vtc.FileVersion = 3; vtc.DataType = 2;