Skip to content

Commit

Permalink
Add somato dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
teekuningas committed Apr 6, 2024
1 parent 1c00c51 commit 25233a6
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions meggie/utilities/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create_limo_experiment(name, author, prefs, set_previous_experiment=True):
return experiment


def create_sample_experiment(name, author, prefs, set_previous_experiment=True):
def create_somato_experiment(name, author, prefs, set_previous_experiment=True):
"""Generate one-subject experiment based on the mne sample data.
Parameters
Expand All @@ -78,6 +78,37 @@ def create_sample_experiment(name, author, prefs, set_previous_experiment=True):

experiment = initialize_new_experiment(name, author, prefs, set_previous_experiment)

mne.datasets.somato.data_path()

somato_data = (
str(mne.datasets.somato.data_path()) + "/sub-01/meg/sub-01_task-somato_meg.fif"
)

experiment.create_subject("sub-01", somato_data)

return experiment


def create_sample_experiment(name, author, prefs, set_previous_experiment=True):
"""Generate one-subject experiment based on the mne somato data.
Parameters
----------
name : str
Name of the experiment.
author : str
Name of the author.
prefs : meggie.mainwindow.preferences.PreferencesHandler
A preferences object.
Returns
-------
meggie.experiment.Experiment
The new experiment.
"""

experiment = initialize_new_experiment(name, author, prefs, set_previous_experiment)

sample_data = (
str(mne.datasets.sample.data_path()) + "/MEG/sample/sample_audvis_raw.fif"
)
Expand All @@ -88,6 +119,13 @@ def create_sample_experiment(name, author, prefs, set_previous_experiment=True):

def get_open_datasets():
return {
"limo": {"title": "LIMO Dataset", "constructor": create_limo_experiment},
"sample": {"title": "MNE Sample Data", "constructor": create_sample_experiment},
"limo": {"title": "MNE LIMO Dataset", "constructor": create_limo_experiment},
"somato": {
"title": "MNE Somato Dataset",
"constructor": create_somato_experiment,
},
"sample": {
"title": "MNE Sample Dataset",
"constructor": create_sample_experiment,
},
}

0 comments on commit 25233a6

Please sign in to comment.