A method is presented for simultaneous correction of linear geometric distortions and interscan patient motion in echoplanar imaging (EPI). The technique does not require the acquisition of specialized scans other than high-resolution magnetic resonance images. The method is based on a generalized surface-based coregistration algorithm, which accounts for a complete 3-dimensional affine transformation, i.e., rotations, translations, scaling, and shearing, between two volumetric image data sets. Any minimally distorted high-resolution scan may serve as a reference data set, to which the EPI data set is matched. The algorithmic accuracy was assessed using simulated data sets with known affine distortions. The deviation of the parameters determined by the coregistration program from the true values typically was 1% or less. Precise alignment of functional and anatomic information will be important for many future clinical applications.