Home > bioelectromagnetism > avw_smooth.m

avw_smooth - Guassian smoothing Usage: avw = avw_smooth(avw,fwhm) avw is the Analyze struct returned by avw_read fwhm is an odd integer >= 1 or a tuple of odd integers [x y z], which determine the voxels to convolve with the Gaussian kernel (default = 3, a 3x3x3 convolution) see also smooth3

0001 function avw = avw_smooth(avw,fwhm) 0002 0003 % avw_smooth - Guassian smoothing 0004 % 0005 % Usage: avw = avw_smooth(avw,fwhm) 0006 % 0007 % avw is the Analyze struct returned by avw_read 0008 % fwhm is an odd integer >= 1 or a tuple of odd integers [x y z], which 0009 % determine the voxels to convolve with the Gaussian kernel 0010 % (default = 3, a 3x3x3 convolution) 0011 % 0012 % see also smooth3 0013 % 0014 0015 % $Revision: 1.2 $ $Date: 2005/08/14 21:18:55 $ 0016 0017 % Copyright (C) 2002 Darren L. Weber 0018 % 0019 % This program is free software; you can redistribute it and/or 0020 % modify it under the terms of the GNU General Public License 0021 % as published by the Free Software Foundation; either version 2 0022 % of the License, or (at your option) any later version. 0023 % 0024 % This program is distributed in the hope that it will be useful, 0025 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0026 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0027 % GNU General Public License for more details. 0028 % 0029 % You should have received a copy of the GNU General Public License 0030 % along with this program; if not, write to the Free Software 0031 % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 0032 % USA. 0033 0034 % History: 08/2002, Darren.Weber_at_radiology.ucsf.edu 0035 % 0036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0037 0038 if ~exist('fwhm','var'), fwhm = 3; end 0039 if isempty(fwhm), fwhm = 3; end 0040 0041 fprintf('...gaussian smoothing...'); tic; 0042 0043 avw.img = smooth3(avw.img,'gaussian',fwhm); 0044 0045 t = toc; fprintf('done (%5.2f sec)\n',t); 0046 0047 return

Generated on Mon 15-Aug-2005 15:36:19 by