Segmentation of MR brain scans has received an enormous amount of attention in the medical imaging community over the past several years. In this paper we propose a new and general segmentation algorithm involving 3D adaptive K-Means clustering in a multiresolution wavelet basis. The voxel image of the brain is segmented into five classes namely, cerebrospinal fluid, gray matter, white matter, bone and background (remaining pixels). The segmentation problem is formulated as a maximum a posteriori (MAP) estimation problem wherein, the prior is assumed to be a Markov Random Field (MRF). The MAP estimation is achieved using an iterated conditional modes technique (ICM) in wavelet basis. Performance of the segmentation algorithm is demonstrated via application to phantom images as well as MR brain scans.