In this paper, an automated method for identifying the overall range of the tumor and extracting the starting point of brain tumors in Magnetic Resonance Imaging is presented. In this study, images of patients with glioblastoma multiforme were used. By first combining the features of the four MRI modalities, annoying areas such as the eyes, skull, and cerebrospinal fluid that may be problematic are removed. Brain tumors are highly bright in T1-Post images and dark in T1 images. Therefore, calculating the difference between these two images improves the resolution of the tumor area. After performing preprocessing and increasing the resolution of the tumor area, the enclosed frame (BB) algorithm is used. This algorithm is an automatic and fast segmentation method that determines the location of the tumor and its approximate size. After finding the presence of the tumor, the firefly algorithm is used to find the initial point of the tumor. By defining the objective function of moving fireflies to a point that has the maximum light intensity, we can find the point where the probability of a tumor is high. Next, using the growth of the tumor area, the entire tumor area can be extracted. The results show the appropriate speed and accuracy of the proposed method.