ROI Toolbox Docs

Documentation: Smooth (spm_smooth_ui.m)
--------------------------------------------
Jeff Cooper
12/16/02

1. Summary

spm_smooth_ui is simply the SPM smoothing facility.  Hitting
the Smooth button in the ROI Toolbox is exactly like hitting
the Smooth button in SPM.  The facility allows spatial
smoothing of multiple .img files by convolving each voxel
of the image with a Gaussian kernel of user-specified size.
	The user is directed to SPM documentation on why you 
would want to do this, specifically Matthew Bretts smoothing
tutorial:
	http://www.mrc-cbu.cam.ac.uk/Imaging/smoothing.html
	but in a nutshell, smoothing accomplishes three things
when applied to .img files (quoted from SPM99 manual, p. 23):
	- increases signal to noise ratio
	- conditions the data so it conforms more closely to 
Gaussian field model (i.e., transforms noise in the data more
closely to independent, equally distributed noise)
	- helps flatten out differences in individual anatomies.
	Obviously, with reference to ROI .img files, the first 
two of these dont make a ton of difference (although the 
noise issue is worth considering, even with a binary-valued
ROI image), but the last is the main reason  smoothing the 
ROI helps make sure that a single ROI file applied to several
subjects actually covers the region of interest for
all those subjects despite slight individual differences in
anatomy.  It can also help remove arbitrarily rough edges that
can be left in an ROI image created from anatomical sources 
(i.e., the Talairach Daemon) or user-specified limits
(functional ROIs, XYZ_rois, etc.).
	If the user is creating individual ROIs specific to a
particular subject, smoothing may not be necessary or desirable,
but if an ROI is to be used in any kind of group analysis, its
probably a good idea.


2. Usage

spm_smooth_ui

spm_smooth_ui can be accessed from the command line, the Smooth
button in SPM, or the Smooth button in the ROI Toolbox.  The 
interface is quite simple; the user is first queried for the
size of the Gaussian kernel in mm that they would like
to use, and then is asked to select the image files that they
would like smoothed; the program then goes ahead and smooths them.
	The question of what kernel size to use is important,
though.  Gaussian kernels are generally specified by referring
to their FWHM  Full-Width-Half-Maximum  size, which means
the width of the Gaussian curve halfway between zero and the 
curves maximum.  This number is specified in mm, and can be either
a single number  in which case SPM uses a spherical, evenly-
shaped kernel to smooth  or a three number vector specifying 
FWHM in the x, y, and z dimensions respectively (with numbers
separated with white space, like 6 7 2), in which case 
SPM will design a non-spherical (also called anisotropic) kernel
with the appropriate FWHM in each dimension.
	Generally, unless theres an outstanding reason to use
an anisotropic kernel, spherical kernels are used.  But how do you
pick how large your kernel should be?
	The idea in smoothing is that you can best recover signal
from noise by using a filter that is matched to the signal.  So
a good guideline is to try and use a smoothing kernel whose
size is somewhat connected to the spatial size of the activation
youre interested in.  If you want to look at large-scale
activations on the surface of the brain across several subjects,
for example, where anatomical variability will probably make
activations spread out across a relatively wide region, choosing
a relatively wide kernel, like 10 or 15 mm, may make sense.  By
contrast, if youre trying to detect a signal at a relatively
defined region of only a few mm, using a small kernel or no
smoothing may make sense.
	If youre not sure what size to use, a good generic rule of
thumb is to use a kernel two or three times your voxel size  so
if your voxels are 2 x 2 x 2 mm, a 4-6 mm kernel would be a good
choice to smooth by, without any other information.


3. Output

The smoothing script outputs one new .img file for each input .img
file; the new .img files are always in the same directory as 
the input files.  The new files have the same filenames as the old
ones, except with s appended to the front; for an input file
called ROI_Amygdala.img, the new file would be called
sROI_Amygdala.img.  The new file has all the same dimensions 
as the old one; the only difference is it is spatially smoothed.


4. Last Bits

spm_smooth_ui.m is part of the SPM99 brain image analysis package, 
and was written by John Ashburner and others as part of that package.
It requires several other functions in that package in order to
run.

This code is in a very fluid state of development, and any suggested
modifications are welcomed and invited.  Please contact Jeff Cooper
in the Stanford Psychology Department at jcooper@stanford.edu with 
any questions about usage, bug reports, or suggestions for further
revision.  Good luck...

