A 3D Framework for the Musculoskeletal Segmentation of Magnetic Resonance Images