Skip to content

Commit a76f95a

Browse files
1 parent cb21777 commit a76f95a

450 files changed

Lines changed: 5844 additions & 1876 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Binary file not shown.
Binary file not shown.

dev/_downloads/785b84cf493399f25344bd9959efcad5/plot_bids_dataset_example.zip renamed to dev/_downloads/1748d5135481b00a862aa2a9c0bc4abd/bids_dataset_example.zip

3.95 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/408ca4ffd0ea1f76faa9ef602734ac94/plot_tuh_eeg_corpus.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"# Author: Lukas Gemein <l.gemein@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport tempfile\n\nimport matplotlib.pyplot as plt\nimport mne\nimport numpy as np\nfrom numpy import multiply\n\nfrom braindecode.datasets import TUH\nfrom braindecode.preprocessing import (\n Preprocessor,\n create_fixed_length_windows,\n preprocess,\n)\n\nmne.set_log_level(\"ERROR\") # avoid messages every time a window is extracted"
18+
"# Authors: Lukas Gemein <l.gemein@gmail.com>\n# Sarthak Tayal <sarthaktayal2@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport tempfile\n\nimport matplotlib.pyplot as plt\nimport mne\nimport numpy as np\nfrom numpy import multiply\n\nfrom braindecode.datasets import TUH\nfrom braindecode.preprocessing import (\n Preprocessor,\n create_fixed_length_windows,\n preprocess,\n)\n\nmne.set_log_level(\"ERROR\") # avoid messages every time a window is extracted"
1919
]
2020
},
2121
{
@@ -112,7 +112,7 @@
112112
"cell_type": "markdown",
113113
"metadata": {},
114114
"source": [
115-
"### Combining preprocessing steps\n\nNext, we use braindecode's preprocess to combine and execute several preprocessing\nsteps that are executed through 'mne':\n\n- Crop the recordings to a region of interest\n- Re-reference all recordings to 'ar' (requires load)\n- Pick channels of interest\n- Scale signals to micro volts (requires load)\n- Clip outlier values to +/- 800 micro volts (requires load)\n- Resample recordings to a common frequency (requires load)\n\n"
115+
"### Combining preprocessing steps\n\nNext, we use braindecode's preprocess to combine and execute several preprocessing\nsteps that are executed through 'mne':\n\n- Crop the recordings to a region of interest\n- Pick channels of interest\n- Re-reference all recordings to average reference (CAR) (requires load)\n- Scale signals to micro volts (requires load)\n- Clip outlier values to +/- 800 micro volts (requires load)\n- Resample recordings to a common frequency (requires load)\n\n"
116116
]
117117
},
118118
{
@@ -123,7 +123,7 @@
123123
},
124124
"outputs": [],
125125
"source": [
126-
"def custom_crop(raw, tmin=0.0, tmax=None, include_tmax=True):\n # crop recordings to tmin \u2013 tmax. can be incomplete if recording\n # has lower duration than tmax\n # by default mne fails if tmax is bigger than duration\n tmax = min((raw.n_times - 1) / raw.info[\"sfreq\"], tmax)\n raw.crop(tmin=tmin, tmax=tmax, include_tmax=include_tmax)\n\n\ntmin = 1 * 60\ntmax = 6 * 60\nsfreq = 100\nfactor = 1e6\n\npreprocessors = [\n Preprocessor(\n custom_crop, tmin=tmin, tmax=tmax, include_tmax=False, apply_on_array=False\n ),\n Preprocessor(\"set_eeg_reference\", ref_channels=\"average\", ch_type=\"eeg\"),\n Preprocessor(\"pick_channels\", ch_names=short_ch_names, ordered=True),\n Preprocessor(\n lambda data: multiply(data, factor), apply_on_array=True\n ), # Convert from V to uV\n Preprocessor(lambda x: np.clip(x, a_min=-800, a_max=800), apply_on_array=True),\n Preprocessor(\"resample\", sfreq=sfreq),\n]"
126+
"def custom_crop(raw, tmin=0.0, tmax=None, include_tmax=True):\n # crop recordings to tmin \u2013 tmax. can be incomplete if recording\n # has lower duration than tmax\n # by default mne fails if tmax is bigger than duration\n tmax = min((raw.n_times - 1) / raw.info[\"sfreq\"], tmax)\n raw.crop(tmin=tmin, tmax=tmax, include_tmax=include_tmax)\n\n\ntmin = 1 * 60\ntmax = 6 * 60\nsfreq = 100\nfactor = 1e6\n\npreprocessors = [\n Preprocessor(\n custom_crop, tmin=tmin, tmax=tmax, include_tmax=False, apply_on_array=False\n ),\n # pick first so the average reference does not pull in artifacts from dropped channels\n Preprocessor(\"pick_channels\", ch_names=short_ch_names, ordered=True),\n Preprocessor(\"set_eeg_reference\", ref_channels=\"average\", ch_type=\"eeg\"),\n Preprocessor(\n lambda data: multiply(data, factor), apply_on_array=True\n ), # Convert from V to uV\n Preprocessor(lambda x: np.clip(x, a_min=-800, a_max=800), apply_on_array=True),\n Preprocessor(\"resample\", sfreq=sfreq),\n]"
127127
]
128128
},
129129
{
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)