Background: Magnetic resonance imaging (MRI) is widely applied for examination and diagnosis of brain tumors based on its advantages of high resolution in detecting the soft tissues and especially of its harmless radiation damages to human bodies. The goal of the processing of images is automatic segmentation of brain edema and tumors, in different dimensions of the magnetic resonance images. Methods: The proposed method is based on the unsupervised method which discovers the tumor region, if there is any, by analyzing the similarities between two hemispheres and computes the image size of the goal function based on Bhattacharyya coefficient which is used in the next stage to detect the tumor region or some part of it. In this stage, for reducing the color variation, the gray brain image is segmented, then it is turned to gray again. The self-organizing map (SOM) neural network is used the segmented brain image is colored and finally the tumor is detected by matching the detected region and the colored image. This method is proposed to analyze MRI images for discovering brain tumors, and done in Bu Ali Sina University, Hamedan, Iran, in 2014. Results: The results for 30 randomly selected images from data bank of MRI center in Hamedan was compared with manually segmentation of experts. The results showed that, our proposed method had the accuracy of more than 94% at Jaccard similarity index (JSI), 97% at Dice similarity score (DSS), and 98% and 99% at two measures of specificity and sensitivity. Conclusion: The experimental results showed that it was satisfactory and can be used in automatic separation of tumor from normal brain tissues and therefore it can be used in practical applications. The results showed that the use of SOM neural network to classify useful magnetic resonance imaging of the brain and demonstrated a good performance.