We present a fully automatic scheme for the registration of MR images. The registration is carried out as a combination of an affine and an elastic transformation. The affine part is generated by means of an affine Principal Components Analysis (PCA), which is an extension of the standard rigid PCA. We use the affine PCA as a preparatory step to guarantee maximum spatial similarity for the subsequent elastic transformation. The elastic transformation itself is based on a displacement vector field generated by means of Monte Carlo methods. Contrary to other Monte Carlo methods that define feature boundaries based on the grey-value transition of adjacent pixels, we make use of more accurate feature boundaries segmented by means of statistical feature extraction methods. We also present a validation method for verifying the segmentation results for simulated MR images. Although discussed in the context of medical imaging, our approach can also be applied as a general-purpose registration...