The use of medical imaging, which is very popular today, is increasing daily, so a need is felt more than ever to obtain the approaches for the automatic segmentation of these images. In our article, a novel approach is proposed for the improvement of the segmentation results in a way that has good efficiency and good accuracy. Due to uncertainty in many aspects of image processing, the assumptions for these uncertainties are considered. These uncertainties include the additive and non-additive noises at the low level of the image processing and the inaccuracy in the basic assumptions of the algorithm, and the interpretation ambiguities during the high-level image processing. In this paper, a distinct deep neural network, which is entirely basis on self-attention among the patches of the neighbor image sans any convolution operation, is presented. This method can achieve segmentation with more accuracy. The network input is a three-dimensional image block, which divides our network into n(3) 3D patches. In this network, n = 3 or n = 5. Furthermore, for each patch, it computes a one-dimensional embedding. Our network forecasts the segmentation mapping for the block central patch basis on the self- attention among the embeddings of this patch. Also, the approaches for the model pre-training in the big sets of un-tagged images are presented. The results of our tests display that the benefit of our network over the convolutional neural network can be considerable (by using the pre-training) when the data of the tagged training are small. For example, in the Brain Cortical Plate dataset, the proposed method had the values equal to 0.884, 0.921 and 0.232 for DSC, HD95 and ASSD, which performed better than the similar methods.