Realignment and Coregistration

The objective of spatial coregistration is to spatially align one or more images to each other. In functional neuroimaging data analysis, spatial coregistration techniques are used primarily 1) to correct for subject movement artifacts, and 2) to align functional (EPI) data with structural (anatomical) data. There are various algorithms that can be used for spatial coregistration. Both SPM5 and FSL implement several algorithms. The end effect of any given algorithm is to generate a transformation matrix. The transformation matrix defines the rotations, translations, and possibly shears, that need to be applied to one image in order to spatially overlay it on top of the other image.

Implementing a spatial coregistration data processing step requires:

The above set of processing steps applies to functional->functional, functional->structural, and structural->structural coregistration. Coregistration of functional images within a "run" or "series" is typically referred to as "realignment" or "motion-correction."

Coregistration in SPM5

Analyses in SPM5 are specified in terms of "jobs" and handled by spm_jobman.m
In terms of the underlying Matlab code, jobs are defined in structure array. The format of the structure array is very generic and hierarchically organized into sets of nodes (structures with required and optional fields). It actually uses structures within structures within structures .... The information that controls various analyses, e.g. parameters and lists of files, is specified at the bottom of this hierarchy. It can feel a bit daunting to inspect the job structure because the field names that are visible to the user aren't terribly informative until one gets down to the lower levels.

Coregistration in FSL

FSL relies on two different programs for coregistration/realignment: flirt and mcflirt. Mcflirt is the "motion-correction" version of flirt used for aligning volumes in functional runs. Both programs can be used in command-line mode; additionally, flirt has a GUI.