In order to perform medical image registration, landmarks are used to settle correspondences between images. A landmark is a voxel in the image that corresponds to a well-defined point in the anatomy. Manual landmarking is a difficult, tedious and time-consuming procedure that would gain to be automated. We propose a bayesian approach for automatic landmarking. Using training data, we learn the geometry through a probabilistic template. Landmarking consists then in estimating an affine transformation mapping the image onto the template. We use gradient ascent in the likelihood function to perform this task. Experiments validate the methodology for landmarking the temporal lobe in MR brain images.