Custom DataLoader for .mat file

Hello, I am trying to segment medical image and i need help on creating a DataLoader to take into a CNN .mat images. My main image and mask are saved in a same mat file. So, I need help to create custom dataloader to read the main image and mask from the same mat file.

Thank you

https://pytorch.org/tutorials/beginner/data_loading_tutorial.html

https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html