We describe a method for correcting the distortions present in echo planar images (EPI) and registering the EPI to structural MRI. A fieldmap is predicted from an air / tissue segmentation of the MRI using a perturbation method and subsequently used to unwarp the EPI data. Shim and other missing parameters are estimated by registration. We obtain results that are similar to those obtained using fieldmaps, however neither fieldmaps, nor knowledge of shim coefficients is required.