| Spatial Processing Demonstrations |
Introduction
You can click here download two sample programs that demonstrate some of the common spatial processing for neuroimaging. These concepts are describe in my neuroimaging lectures.
Spatial Transformations
During MRI analysis, we often coregister our images - i.e. we will warp different images to look similar to each other. In particular, we will need to conduct two types of coregistration - motion correct (where the series of fMRI images are aligned to adjust for the participant moving their head during the scanning) and normalization (where we align images from different people to allow group inferences to be made). Regardless of whether you are using SPM, FSL's FLIRT or another tool, much of the coregistration is done by applying a linear spatial transformation matrix to warp the images. This transformation matrix can encode rotations, translations, zooms (streching or shrinking) and shear transforms. My simple demo allows you to see how a single matrix can encode multiple linear transformations. Note the sample software allows you to manipulate a 2D image (using a 3x3 matrix), while FLIRT manipulates 3D images (using a 4x4 matrix), but the prinicples are identical.

fMRI data is typically smoothed before we compute statistics. By blurring the data, we can eliminate high frequency noise, and ensure that our data is relatively normaly distributed. In neuroimaging, we classically apply a 3D gaussian smooth, where we adjust the Full Width Half Maximum. My demo software allows you to interactively apply a gaussian smooth to a 2D bitmap image. You can interactively adjust the FWHM (defined in pixels). The program initially displays a white rectangle on a black background, but you can load any image you wish. The source image is shown in the upper left, and the smoothed output is shown in the upper right corner. The lower images show image intensity histograms along the middle line of the source and smoothed images. Note that with a large smoothing kernel you can not distinguish the broad-low contrast left side of the rectangle from the narrow high contrast right side. This demonstrates why it is difficult to determine if smoothed fMRI activation shows recruitment of a larger area of cortex or whether it reflects more activation within the same region of cortex.

![]() |