Commit e10d2010 authored by Alessia Marcolini's avatar Alessia Marcolini
Browse files

Get patient in __getitem__

parent 9278fc8a
......@@ -82,12 +82,13 @@ class NumpyCSVDataset(Dataset):
def __getitem__(self, idx, no_data=False):
label = self._labels_full[self.indexes[idx]]
file = self._files_full[self.indexes[idx]]
patient = self._patients_full[self.indexes[idx]]
data_file = f'{self.data_dir}/{self._files_full[self.indexes[idx]]}'
data = np.load(data_file)
data = self.transforms(data, self.mode, self.size)
data = torch.Tensor(data)
output = {'data': data, 'target': label, 'filename': file}
output = {'data': data, 'target': label, 'filename': file, 'patient': patient}
return output
def get_labels(self):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment