Class-specific weighting for Markov random field estimation: application to medical image segmentation.