forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add fNIRS-motor dataset and tutorial stub
- Loading branch information
Showing
9 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""fNIRS motor dataset.""" | ||
|
||
from .fnirs_motor import data_path, has_fnirs_motor_data, get_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Authors: Eric Larson <[email protected]> | ||
# License: BSD Style. | ||
|
||
from functools import partial | ||
|
||
from ...utils import verbose | ||
from ..utils import (has_dataset, _data_path, _data_path_doc, | ||
_get_version, _version_doc) | ||
|
||
|
||
has_fnirs_motor_data = partial(has_dataset, name='fnirs_motor') | ||
|
||
|
||
@verbose | ||
def data_path(path=None, force_update=False, update_path=True, download=True, | ||
verbose=None): # noqa: D103 | ||
return _data_path(path=path, force_update=force_update, | ||
update_path=update_path, name='fnirs_motor', | ||
download=download) | ||
|
||
|
||
data_path.__doc__ = _data_path_doc.format(name='fnirs_motor', | ||
conf='MNE_DATASETS_FNIRS_MOTOR_PATH') | ||
|
||
|
||
def get_version(): # noqa: D103 | ||
return _get_version('fnirs_motor') | ||
|
||
|
||
get_version.__doc__ = _version_doc.format(name='fnirs_motor') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
.. _tut-fnirs-processing: | ||
Preprocessing fNIRS data | ||
======================== | ||
This tutorial covers how to convert fNIRS data from raw measurements to | ||
HbO/HbR. | ||
.. contents:: Page contents | ||
:local: | ||
:depth: 2 | ||
Here we will work with the :ref:`fNIRS motor data <fnirs-motor-dataset>`. | ||
""" | ||
# sphinx_gallery_thumbnail_number = 3 | ||
|
||
import os | ||
import mne | ||
|
||
fnirs_data_folder = mne.datasets.fnirs_motor.data_path() | ||
fnirs_raw_dir = os.path.join(fnirs_data_folder, 'Participant-1') | ||
raw_intensity = mne.io.read_raw_nirx(fnirs_raw_dir, verbose=True).load_data() | ||
raw_intensity.plot() | ||
|
||
############################################################################### | ||
# Converting from raw intensity to optical density | ||
# ------------------------------------------------ | ||
# | ||
# The first thing we should do is convert from raw intensity values ... | ||
|
||
raw_od = mne.preprocessing.optical_density(raw_intensity) | ||
raw_od.plot() | ||
|
||
############################################################################### | ||
# Converting from optical density to hemoglobin | ||
# --------------------------------------------- | ||
# | ||
# Next we Beer-Lambert ... | ||
|
||
raw_fnirs = mne.preprocessing.beer_lambert_law(raw_od) | ||
raw_fnirs.plot() |