Nuclear magnetic resonance (MR) image analysis has become a major means of the auxiliary medical services. However, intensity inhomogeneity, which is usually named as bias field, causes considerable difficulty in the quantitative analysis of MR images. Thus bias field estimation is a necessary pre-processing step before quantitative analysis of MR data. The Wells model, one of the widely used methods, uses knowledge of tissue intensity properties and intensity inhomogeneities to correct and segment MR images. However, the classical Wells model only uses the intensity information and no spatial information is taken into account, so it is sensitive to the noise. In order to overcome this limitation, the Gibbs theory and the image structure information are used to construct anisotropic Gibbs random field. The traditional Gibbs theory usually loses the information of the beam structure regions and the corner regions. With the spatial information, the anisotropic Gibbs random field can reduce the effect of the noise and contain the information of the beam structure regions and the corner regions. The anisotropic Gibbs random field is incorporated into the Wells model. The experiments of segmenting the brain magnetic resonance images show that the proposed method can obtain better results in an accurate way.