We present an automatic sub-pixel registration algorithm that minimizes the mean square difference of intensities between a reference and a test data set, which can be either tri-dimensional (3-D) volumes or bi-dimensional (2-D) images. It uses spline processing, is based on a coarse-to-fine strategy (pyramid approach), and performs minimization according to a new variation of the iterative Marquardt-Levenberg algorithm for non-linear least-square optimization (MLA). The geometric deformation model is a global 3-D affine transformation, which one may restrict to the case of rigid-body motion (isometric scale, rotation and translation). It may also include a parameter to adjust for image contrast differences. We obtain excellent results for the registration of intra-modality Positron Emission Tomography (PET) and functional Magnetic Resonance Imaging (fMRI) data. We conclude that the multi-resolution refinement strategy is more robust than a comparable single-scale method, being less likely to get trapped into a false local optimum. In addition, it is also faster.