To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit b106159e authored by Lukas Wolf's avatar Lukas Wolf
Browse files

temporary fix for participants w/o extracted datapoints

parent 498e8fca
......@@ -11,8 +11,8 @@ preparation_config = dict()
# 'Direction_task' (dataset: 'dots' or 'processing_speed'):
# 'Position_task' (dataset: 'dots'):
# 'Segmentation_task' (dataset: 'antisaccade', 'dots', or 'processing_speed'):
preparation_config['task'] = 'LR_task'
preparation_config['dataset'] = 'antisaccade'
preparation_config['task'] = 'Direction_task'
preparation_config['dataset'] = 'processing_speed'
# We provide two types of preprocessing on the dataset (minimal preprocessing and maximal preprocessing). Choices are
# 'max'
......
......@@ -71,6 +71,7 @@ class Preparator:
all_EEG = []
all_labels = []
subj_counter = 1
failed_counter = 0
progress = tqdm(sorted(os.listdir(self.load_directory)))
......@@ -111,11 +112,16 @@ class Preparator:
trials = self._extract_events(data, events, select)
labels = self._extract_labels(events, select, subj_counter)
all_EEG.append(trials)
all_labels.append(labels)
subj_counter += 1
#print(f"CUR_DIR {cur_dir}, TRAILS SHAPE: {trials.shape}")
if trials.shape[0] > 0:
all_EEG.append(trials)
all_labels.append(labels)
subj_counter += 1
else:
failed_counter += 1
# save the concatenated arrays
print(f"Failed participants: {failed_counter}")
print('Saving data...')
EEG = np.concatenate(all_EEG, axis=0)
labels = np.concatenate(all_labels, axis=0)
......
Markdown is supported
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