We required a process called rendering in order to display three-dimensional models, including the volume of organs and tissues in medical images. In computer graphics, rendering operations are divided into two general categories: volume rendering and surface rendering. Volume rendering converts all 3D data to a 2D image, while surface rendering first converts surfaces to basic shapes such as dots, lines, and triangles, and then maps the volume level to a 2D image, and through this operation a large part of the data is deleted. In this research, by changing the process of sampling and composition phases, as well as the changes that we apply, in many cases, we improve the performance of ray casting method of VTK by several times, which is also more practical for the visualization of medical images. Since speed addition of multi-volume display of medical images reduces the speed and accuracy of diagnosis by physicians, this study slightly improved the speed of multi-volume rendering. Previous methods of ray casting have slowed down rendering due to the simultaneity of the sampling phase, the composition and lack of proper memory efficiency in cases with a lot of free space between volumes. However, in this study, in order to increase the rendering speed of multi-volume images of medical images, by defining subspace as a method for separating the sampling phase and the composition phase, we have been able to obtain better results for rendering speeds where there is empty space between volumes. Thus, volume visualization of medical images can be provided at a higher frame rate, which gives a better interactive experience to the end user and enhances the application of volume visualization in the medical sciences. A smart selector can be used in future research to decide based on 3D environmental conditions which of the methods will be used to render the 3D environment. As well as, some volumes can be considered as a multi-volume and some volumes as a single-volume on an instantaneous basis; and the rendering speed can be improved far more by sorting it based on depth with two methods of multi-volume and single-volume rendering.