A learning based deformable template matching method for automatic rib centerline extraction and labeling in CT images