www.gusucode.com > images 案例代码 matlab源码程序 > images/SmoothMRIVolumeWith3DGaussianFilterExample.m

    %% Smooth MRI volume with 3-D Gaussian filter
% 
%%
% Load MRI data and display it.

% Copyright 2015 The MathWorks, Inc.

vol = load('mri');
figure
montage(vol.D)
title('Original image volume')
%%
% Smooth the image with a 3-D Gaussian filter. 
siz = vol.siz;
vol = squeeze(vol.D);   
sigma = 2;
 
volSmooth = imgaussfilt3(vol, sigma);
  
figure
montage(reshape(volSmooth,siz(1),siz(2),1,siz(3)))
title('Gaussian filtered image volume')