@smth  Actually, I have thought about this solution, but the problem is that the __len__ of DataLoader and the __len__
of sampler that I created were not equal, I do not see the possibility to handle that situation with the sampler.
I also tried to extract only one slice using __getitem__ from the whole MRI. The problem for this approach is that the memory exploses at some time during training…