This thesis applies Bayesian analysis and Markov random field (MRF) models with MCMC-Gibbs sampling to segment brain MR images into three classes: gray matter, white matter, and cerebrospinal fluid. Synthetic data is used to evaluate the MRF method under different noise conditions. Real brain MR images are also segmented. The MRF model characterizes the spatial dependencies between image pixels. MCMC sampling is used to estimate the posterior distribution and perform segmentation. The results demonstrate the MRF approach can accurately segment images, with better performance on lower noise images.