Automatic image analysis of magnetic resonance (MR) images of the knee is simplified by bringing the knee into a reference position. While the knee is typically put into a reference position during image acquisition, this alignment will generally not be perfect. To correct for imperfections, we propose a two-step process of bone segmentation followed by elastic tissue deformation. The approach makes use of a fully-automatic segmentation of femur and tibia from T1 and T2* images. The segmentation algorithm is based on a continuous convex optimization problem, incorporating regional, and shape information. The regional terms are included from a probabilistic viewpoint, which readily allows the inclusion of shape information. Segmentation of the outer boundary of the cortical bone is encouraged by adding simple appearance-based information to the optimization problem. The resulting segmentation without the shape alignment step is globally optimal. Standard registration is problematic for knee alignment due to the distinct physical properties of the tissues constituting the knee (bone, muscle, etc.). We therefore develop an alternative alignment approach based on a simple elastic deformation model combined with strict enforcement of similarity transforms for femur and tibia based on the obtained segmentations.