Gravar-mail: Connecting Markov random fields and active contour models: application to gland segmentation and classification