Intrascan and interscan intensity inhomogeneities have been identifed as a common source of making many advanced segmentation techniques fail to produce satisfactory results in separating brains tissues from multi-spectral magnetic resonance (MR) images. A common solution is to correct the inhomogeneity before applying the segmentation techniques. This paper presents a method that is able to achieve simultaneous semi-supervised MAP (maximum a-posterior probability) estimation of the inhomogeneity feld and segmentation of brain tissues, where the inhomogeneity is parameterized. Our method can incorporate any available incomplete training data and their contribution can be controlled in a flexible manner and therefore the segmentation of the brain tissues can be optimised. Experiments on both simulated and real MR images have demonstrated that the proposed method estimated the inhomogeneity field accurately and improved the segmentation.