Skip to content

Commit a7fa5c3

Browse files
committed
update set description for participantinfo. clean up example vgg
1 parent ac9f12f commit a7fa5c3

File tree

2 files changed

+2025
-1
lines changed

2 files changed

+2025
-1
lines changed

src/eegdash/main.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import xarray as xr
1111
from .data_utils import BIDSDataset, EEGDashBaseRaw
1212
from braindecode.datasets import BaseDataset, BaseConcatDataset
13+
from collections import defaultdict
1314

1415
class EEGDash:
1516
AWS_BUCKET = 's3://openneuro.org'
@@ -44,8 +45,12 @@ def find(self, query:dict, description_fields:List[str]=['sampling_frequency', '
4445
ch_types = record['channel_types']
4546
s3_path = self.get_s3path(record)
4647
description = {}
48+
participant_fields = ['age', 'gender', 'sex']
4749
for field in description_fields:
48-
description[field] = record[field]
50+
if field in participant_fields:
51+
description[field] = record['participant_tsv'][field]
52+
else:
53+
description[field] = record[field]
4954
datasets.append(BaseDataset(EEGDashBaseRaw(s3_path, {'sfreq': sfreq, 'nchans': nchans, 'n_times': ntimes, 'ch_types': ch_types, 'ch_names': ch_names}, preload=False),
5055
description=description))
5156
# convert to list using get_item on each element

0 commit comments

Comments
 (0)