You could create your own Dataset and concatenate both images:
class MyDataset(Dataset):
    def __init__(self, path_cort, path_slice, transform=None):
        self.data_cort = datasets.ImageFolder(
            root=path_cort, transform=transform)
        self.data_slice = datasets.ImageFolder(
            root=path_slice, transform=transform)
        
    def __getitem__(self, index):
        x_cort, y = self.data_cort[index]
        x_slice, _ = self.data_slice[index]
        x = torch.cat((x_cort, x_slice), dim=1)
        return x, y
    
    def __len__(self):
        return len(self.data_cort) # assert both datasets have equal length