Bias Field Correction and Segmentation of MR Images