Automatic detection of ribs in magnetic resonance images (MRIs) is extremely challenging due to their poor image appearance. Yet localization of ribs is highly important for effective and safe focused ultrasound therapy. % We propose a semi-automatic rib centerline detection method based on combining a rib cage shape model generated from computed tomography (CT) images and a rib appearance model from MRIs. It currently requires the definition of one landmark per rib, and 2 extra landmarks per subject. % Using principle component analysis (PCA), 9 components were sufficient to cover 95\% of the shape variability. The appearance model was based on 4 region-specific random forest classifiers, which were trained to discriminate between rib and non-rib patches. Their classification performance was 89\% on average. % The most likely rib location was determined by accepting the rib centerline hypothesis, generated according to the shape model, whose corresponding image patches provided the highest probability of rib appearance. The extracted centerlines had a mean distance of 8.1 mm from the manually selected centerlines. No cross-overs between ribs were observed.