Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P300 annotations #396

Merged
merged 20 commits into from Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
177b4c5
Change extraction of events from annotations if there is no stim_channel
Jun 1, 2023
9c14443
Update event dictionary and class docstrings
Jun 1, 2023
6dcd6b9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 1, 2023
fbe739a
Merge branch 'NeuroTechX:develop' into P300_annotations
Sara04 Jun 2, 2023
0a2d595
Add mapping of old annotation description to 'Target'/'NonTarget'
Sara04 Jun 5, 2023
fa15891
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2023
02d3881
Formating
Sara04 Jun 5, 2023
8b8e8f3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2023
f7908e0
Merge branch 'develop' into P300_annotations
Sara04 Jun 7, 2023
9ec97c9
Merge branch 'NeuroTechX:develop' into P300_annotations
Sara04 Jun 7, 2023
4916e74
Merge branch 'develop' into P300_annotations
bruAristimunha Jun 26, 2023
f50ef33
Merge branch 'NeuroTechX:develop' into P300_annotations
Sara04 Jun 27, 2023
8ff1d43
Merge branch 'NeuroTechX:develop' into P300_annotations
Sara04 Jun 29, 2023
0e4c03a
Merge branch 'NeuroTechX:develop' into P300_annotations
Sara04 Jul 3, 2023
aacbdd3
Remove dict default class argument as it is a mutable data structure
Sara04 Jul 4, 2023
4ac0cbf
Merge branch 'NeuroTechX:develop' into P300_annotations
Sara04 Jul 4, 2023
e1b91a9
Merge branch 'develop' into P300_annotations
bruAristimunha Jul 8, 2023
df96dbb
Merge branch 'NeuroTechX:develop' into P300_annotations
Sara04 Jul 10, 2023
4c08865
Merge branch 'develop' into P300_annotations
bruAristimunha Jul 11, 2023
d13731c
Updating the whats_new.rst
bruAristimunha Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/whats_new.rst
Expand Up @@ -41,6 +41,7 @@ Bugs
- Fixing :func:`moabb.dataset.bnci.MNEBNCI.data_path` that returned the data itself instead of paths (:gh:`412` by `Pierre Guetschel`_)
- Adding :func:`moabb.datasets.fake` in the init file to use in braindecode object (:gh:`414` by `Bruno Aristimunha`_)
- Fixing the parallel download issue when the dataset have the same directory (:gh:`421` by `Sara Sedlar`_)
- Fixing warning with annotation in the p300 datasets (:gh:`421` by `Sara Sedlar`_)

API changes
~~~~~~~~~~~
Expand Down
10 changes: 9 additions & 1 deletion moabb/datasets/huebner_llp.py
Expand Up @@ -18,7 +18,12 @@

class _BaseVisualMatrixSpellerDataset(BaseDataset, ABC):
def __init__(
self, src_url, n_subjects, raw_slice_offset, use_blocks_as_sessions=True, **kwargs
self,
src_url,
n_subjects,
raw_slice_offset,
use_blocks_as_sessions=True,
**kwargs,
):
self.n_channels = 31 # all channels except 5 times x_* CH and EOGvu
if kwargs["interval"] is None:
Expand All @@ -35,6 +40,7 @@ def __init__(
self.raw_slice_offset = 2_000 if raw_slice_offset is None else raw_slice_offset
self._src_url = src_url
self.use_blocks_as_sessions = use_blocks_as_sessions
self.description_map = {"Stimulus/S 1": "Target", "Stimulus/S 0": "NonTarget"}

@staticmethod
def _filename_trial_info_extraction(vhdr_file_path):
Expand Down Expand Up @@ -69,6 +75,8 @@ def _get_single_subject_data(self, subject):
verbose=None,
)

raw_bvr_list[0].annotations.rename(self.description_map)

if self.use_blocks_as_sessions:
session_name = f"{session_name}_block_{block_idx}"
else:
Expand Down
2 changes: 2 additions & 0 deletions moabb/datasets/sosulski2019.py
Expand Up @@ -104,6 +104,7 @@ def __init__(
self.stimulus_modality = "tone_oddball"
self.n_channels = 31
self.use_soas_as_sessions = use_soas_as_sessions
self.description_map = {"Stimulus/S 21": "Target", "Stimulus/S 1": "NonTarget"}
code = "Spot Pilot P300 dataset"
interval = [-0.2, 1] if interval is None else interval
super().__init__(
Expand Down Expand Up @@ -141,6 +142,7 @@ def _get_single_run_data(self, file_path):
raw.set_montage("standard_1020")
if self.reject_non_iid:
raw.set_annotations(raw.annotations[7:85]) # non-iid rejection
raw.annotations.rename(self.description_map)
return raw

def _get_single_subject_data(self, subject):
Expand Down