Today, using medical imaging devices is essential for disease diagnosis and medical researches. Among these devices, Magnetic Resonance Imaging has the main role. Segmentation of these images is more difficult than natural images because their functional sensitivity is higher than other images. Up to now, many different algorithms have been suggested for segmentation of this type of images. In this paper, we propose an approach in order to improve ant colony algorithm efficiency. In this approach, ant's direction and its tendency to go to the next site is regarded for calculating the probability of choosing the next site by the ant. Moreover, in calculating the probability of the ant's next move, we try to make a balance between the effect of the ant direction and the amount of pheromone distributed. Then this algorithm is used for segmentation of brain magnetic resonance images and diagnosing tumors.