3D medical images segmentation is a very difficult task. It may not be accurate and takes extreme time. In this chapter, we accurately detect the brain tumor from 3D MRI image with less time. The 3D image consists of multiple 2D slices. Segmenting each 2D slice by using the 2D techniques gives more accuracy rather than segmenting the whole 3D image. The integration between K-Means and Particle Swarm Optimization was proposed to segment the 2D MRI slices of the 3D MRI image. We solved the time problem of segmenting all 2D slices of the 3D image. The experiments emphasized the effectiveness of our proposed system in segmenting the 2D and 3D medical images. It achieved 100 % accuracy for the tested 3D dataset and 98.75 % average accuracy for all tested 2D and 3D datasets. The proposed integration reduced time by a mean of 10 min for the tested 2D and 3D datasets.