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

ENH: Read eyetracking data (Eyelink) (Fork of #10855 ) #11152

Merged
merged 105 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
a79807a
rebased upstream/main on top of Dominik Welkes eyetracking commits fr…
scott-huberty Dec 1, 2022
0c28fa4
revised code for reading eyelink eyetracker data, initially by Domini…
scott-huberty Dec 1, 2022
1f239fd
minor refactor
scott-huberty Jan 19, 2023
3fe784d
removed preprocessing funcs, to be moved to separate PR [ci skip]
scott-huberty Jan 20, 2023
2971f8d
moved Pandas import, use _check_pandas_installed
scott-huberty Jan 21, 2023
247ea24
codespell typo fix
scott-huberty Jan 21, 2023
74928a1
improve setting fiff channel info
dominikwelke Jan 5, 2023
0055c84
minor update
dominikwelke Jan 6, 2023
e024a5d
make set_channel_types() work with eyetrack data (fiff-coil and fiff-…
dominikwelke Jan 6, 2023
cb97880
minor fix FIFF channel setting
dominikwelke Jan 6, 2023
f5626c9
fix after scott's refactoring
dominikwelke Jan 22, 2023
f9d6d8a
codespell
dominikwelke Jan 22, 2023
7f4b803
change _create_info() to use util function for ch_types
dominikwelke Jan 23, 2023
b5ca7f9
Merge pull request #1 from dominikwelke/mne-eyetrack_revisions
scott-huberty Jan 23, 2023
f4d6556
split into two different channel-types (gaze/pupil)
dominikwelke Jan 25, 2023
7e593db
codespell
dominikwelke Jan 25, 2023
f6a0e04
change default unit for pupil to AU
dominikwelke Jan 25, 2023
e5714a9
adapt plot defaults
dominikwelke Jan 25, 2023
902e361
bug fix from last commit
scott-huberty Jan 25, 2023
b6e5a5b
Make sure mono recording has eye in ch_name as I said it should!
scott-huberty Jan 25, 2023
e73a56b
renamed mne.io.eyetracking -> mne.io.eyelink
scott-huberty Jan 26, 2023
b92270f
staging deletion of mne/io/eyetracking after rename in previous commit
scott-huberty Jan 26, 2023
337f631
refactor _create_info
scott-huberty Jan 26, 2023
2852f50
fix: allow picking of split eyetrack ch types ('pos','pupil')
scott-huberty Jan 27, 2023
07d9f9b
fix: error caught by mne/io/test_pick. Add eyetrack chs to valid_chan…
scott-huberty Jan 27, 2023
02ada5a
fix: error caught by test_defaults. split eyetrack ch scalings in mne…
scott-huberty Jan 27, 2023
df5f436
fix: test_epochs error. channel_indices_by_type should account for sp…
scott-huberty Jan 27, 2023
83661b5
fix: test_plotting_order_consistency account for split eyetrack ch_types
scott-huberty Jan 27, 2023
ff22a55
Make sure 2000Hz files can be parsed
scott-huberty Jan 30, 2023
69c92ff
remove eyetrack types from _DATA_CH_TYPES_SPLIT (undo of change in f4…
scott-huberty Jan 30, 2023
e653a26
added to and fixed flake in mne/io/eyelink/tests
scott-huberty Jan 30, 2023
9898c9f
update commit hash in mne.io.test.test_constants
scott-huberty Jan 31, 2023
f3262e5
refactor _fill_times
scott-huberty Jan 31, 2023
1a04e4c
refactored _make_eyelink_annots. include annotations for gaps
scott-huberty Feb 1, 2023
75f4d51
fixed flakes in f3262e5
scott-huberty Feb 1, 2023
a371809
documentation and mini-tutorial
dominikwelke Feb 1, 2023
063bc09
renamed test_eyetrack.py -> test_eyelink.py and added tests
scott-huberty Feb 2, 2023
6ad5b69
change default plot unit for gaze pos to 'px'
dominikwelke Feb 2, 2023
b963dea
move code to set specific eyetrack channel info to mne/channels
dominikwelke Feb 2, 2023
b2fca50
DOC: add pandas and annotation cross refs, remove other unneeded back…
scott-huberty Feb 2, 2023
6e54ef7
Merge branch 'mne-eyetrack_revisions' of github.com:scott-huberty/mne…
scott-huberty Feb 2, 2023
1fa7db8
FIX: pydocstyle errors in mne.io.eyelink
scott-huberty Feb 2, 2023
7cbd27e
TEMP: remove before merge.. mne.io.tests.test_constants added @pytest…
scott-huberty Feb 2, 2023
86d342f
Merge branch 'main' into mne-eyetrack_revisions
scott-huberty Feb 2, 2023
3ff8e3a
FIX: fix flakes in tutorial ( a371809 ). moved all imports to top (fl…
scott-huberty Feb 2, 2023
97e9e06
renamed tutorials/preprocessing/80_eyetracking ... -> 90_eyetracking ...
scott-huberty Feb 2, 2023
d2a1bce
FIX: codespell in tutorial and mne/channels/channels.py
scott-huberty Feb 2, 2023
15b6833
DOC: added eyetrack description to doc_dict['pick_types_params']
scott-huberty Feb 2, 2023
a159977
FIX: clarify to CI that pandas is required
scott-huberty Feb 2, 2023
658a840
FIX: pandas import error
scott-huberty Feb 2, 2023
e55b148
FIX, DOC, STY: proper docstring formatting for mne.io.eyelink
scott-huberty Feb 3, 2023
efac50c
move set_channel_types_eyetrack to preprocessing.eytracking
dominikwelke Feb 3, 2023
1d64739
FIX: flake
dominikwelke Feb 3, 2023
811cc6d
ENH: refactored EYELINK_COLS / infer_col_names / _create_info
scott-huberty Feb 3, 2023
f151763
Merge branch 'mne-eyetrack_revisions' of github.com:scott-huberty/mne…
scott-huberty Feb 3, 2023
71eea03
FIX: flake in eyelink __init__
scott-huberty Feb 3, 2023
0968d37
DOC: improve preprocessing DOC
dominikwelke Feb 3, 2023
92f6734
FIX: missing newline
dominikwelke Feb 3, 2023
6347f05
FIX, ENH: added nirs TD channels bc they exist in mne-tools/fiff-cons…
scott-huberty Feb 3, 2023
811385c
Merge branch 'mne-eyetrack_revisions' of github.com:scott-huberty/mne…
scott-huberty Feb 3, 2023
2177179
ENH: some sanity checks on input data
scott-huberty Feb 6, 2023
93695fa
FIX: bug in _triage_eyetrack_pick made test_ica.py :: test_bad_channe…
scott-huberty Feb 6, 2023
330dac5
FIX: corrected path to eyetracking tut in conf.py
scott-huberty Feb 6, 2023
8d1c895
Revert "change default plot unit for gaze pos to 'px' until tests pass"
scott-huberty Feb 6, 2023
56d7c55
FIX: CI data download
dominikwelke Feb 7, 2023
bd870fe
TST: Ping CIs
larsoner Feb 7, 2023
5fcd5c0
FIX: Perms
larsoner Feb 7, 2023
8abb893
Convert HREF Pos data to RAD
scott-huberty Feb 27, 2023
fb1c28f
FIX: flake!
scott-huberty Feb 27, 2023
513636c
ENH, DOC: I/O documentation for reading eyetracking data
scott-huberty Mar 6, 2023
ce54bfd
FIX: docstring mistakes that were causing build warnings
scott-huberty Mar 6, 2023
f114e09
ENH: set meas_date for eyelink files
scott-huberty Mar 6, 2023
530e48f
ENH: additional test for correct meas_date
scott-huberty Mar 6, 2023
6bc9c4b
Merge branch 'main' into mne-eyetrack_revisions
scott-huberty Mar 6, 2023
addbd2a
STY: changed plot scaling defaults to be calibrated to radian data
scott-huberty Mar 6, 2023
d9e0297
ENH: Report datatype to user in logger
scott-huberty Mar 6, 2023
74eef69
STY: Changed eyetrack channel type names to eyegaze, pupil
scott-huberty Mar 6, 2023
7b63bb1
FIX: flake
scott-huberty Mar 6, 2023
804444f
DOC: additional info to preprocessing tut
scott-huberty Mar 6, 2023
6d68e97
DOC: FIX: typo in I/O tut
scott-huberty Mar 6, 2023
a9fed88
Merge branch 'mne-eyetrack_revisions' of https://github.com/scott-hub…
scott-huberty Mar 6, 2023
c88d11c
FIX, STY: replaced deprecated logger.warn method, revised messages
scott-huberty Mar 6, 2023
0c8ff3c
Merge branch 'mne-eyetrack_revisions' of https://github.com/scott-hub…
scott-huberty Mar 6, 2023
9fcdc28
FIX: file handling issue in get_recording_datetime
scott-huberty Mar 6, 2023
ac3a63f
DOC: updated tutorial
scott-huberty Mar 6, 2023
0ee3a5b
updated tut after scaling changes from earlier commit
scott-huberty Mar 6, 2023
284a0b6
FIX: revised eyelink/tests now that raw.annotations will have a datet…
scott-huberty Mar 7, 2023
72bc495
Merge branch 'main' into mne-eyetrack_revisions
scott-huberty Mar 7, 2023
da3a5d9
Merge branch 'main' into mne-eyetrack_revisions
scott-huberty Mar 8, 2023
7ae6b76
FIX: updated test now that eyetrack ch_type changed
scott-huberty Mar 8, 2023
e634145
remove non-SI FIFF units
dominikwelke Mar 14, 2023
5ad2cf0
Merge remote-tracking branch 'upstream/main' into mne-eyetrack_revisions
dominikwelke Mar 15, 2023
9157d98
DOC: update io tutorial
dominikwelke Mar 15, 2023
691c2e8
test: update fiff commit in test_sonstants.py
dominikwelke Mar 15, 2023
55bda16
TST: Ping CIs
larsoner Mar 15, 2023
08091af
Updated mne-testing-data verions
scott-huberty Mar 15, 2023
aca035e
Added test for raidan conversion
scott-huberty Mar 15, 2023
c485974
Merge branch 'main' into mne-eyetrack_revisions
scott-huberty Mar 15, 2023
e9b7af2
Merge branch 'mne-eyetrack_revisions' of github.com:scott-huberty/mne…
scott-huberty Mar 15, 2023
286b95b
FIX: test_radian requires pandas
scott-huberty Mar 16, 2023
4ae1d80
Merge branch 'main' into mne-eyetrack_revisions
larsoner Mar 16, 2023
c709c36
Update test_constants.py
larsoner Mar 25, 2023
70ccc1c
DOC: Update changelog
scott-huberty Mar 27, 2023
c13db88
Merge branch 'main' into mne-eyetrack_revisions
scott-huberty Mar 27, 2023
f011d7a
FIX: Skip
larsoner Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/_includes/data_formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ EEG :ref:`Persyst <import-persyst>` .lay :func:`mn
NIRS :ref:`NIRx <import-nirx>` directory :func:`mne.io.read_raw_nirx`

NIRS :ref:`BOXY <import-boxy>` directory :func:`mne.io.read_raw_boxy`

EYETRACK SR eyelink ASCII files .asc :func:`mne.io.read_raw_eyelink`
============ ============================================ ========= ===================================

More details are provided in the tutorials in the :ref:`tut-data-formats`
Expand Down
1 change: 1 addition & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Enhancements
- Add automatic projection of sEEG contact onto the inflated surface for :meth:`mne.viz.Brain.add_sensors` (:gh:`11436` by `Alex Rockhill`_)
- Allow an image with intracranial electrode contacts (e.g. computed tomography) to be used without the freesurfer recon-all surfaces to locate contacts so that it doesn't have to be downsampled to freesurfer dimensions (for microelectrodes) and show an example :ref:`ex-ieeg-micro` with :func:`mne.transforms.apply_volume_registration_points` added to aid this transform (:gh:`11567` by `Alex Rockhill`_)
- Use new :meth:`dipy.workflows.align.DiffeomorphicMap.transform_points` to transform a montage of intracranial contacts more efficiently (:gh:`11572` by `Alex Rockhill`_)
- Add support for eyetracking data using :func:`mne.io.read_raw_eyelink` (:gh:`11152` by `Dominik Welke`_ and `Scott Huberty`_)

Bugs
~~~~
Expand Down
3 changes: 2 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
# Undocumented (on purpose)
'RawKIT', 'RawEximia', 'RawEGI', 'RawEEGLAB', 'RawEDF', 'RawCTF', 'RawBTi',
'RawBrainVision', 'RawCurry', 'RawNIRX', 'RawGDF', 'RawSNIRF', 'RawBOXY',
'RawPersyst', 'RawNihon', 'RawNedf', 'RawHitachi', 'RawFIL',
'RawPersyst', 'RawNihon', 'RawNedf', 'RawHitachi', 'RawFIL', 'RawEyelink',
# sklearn subclasses
'mapping', 'to', 'any',
# unlinkable
Expand Down Expand Up @@ -1231,6 +1231,7 @@ def reset_warnings(gallery_conf, fname):
f'{tu}/{si}/plot_creating_data_structures.html': f'{tu}/{si}/10_array_objs.html', # noqa E501
f'{tu}/{si}/plot_point_spread.html': f'{tu}/{si}/70_point_spread.html',
f'{tu}/{si}/plot_dics.html': f'{tu}/{si}/80_dics.html',
f'{tu}/{tf}/plot_eyetracking.html': f'{tu}/preprocessing/90_eyetracking_data.html', # noqa E501
f'{ex}/{co}/mne_inverse_label_connectivity.html': f'{mne_conn}/{ex}/mne_inverse_label_connectivity.html', # noqa E501
f'{ex}/{co}/cwt_sensor_connectivity.html': f'{mne_conn}/{ex}/cwt_sensor_connectivity.html', # noqa E501
f'{ex}/{co}/mixed_source_space_connectivity.html': f'{mne_conn}/{ex}/mixed_source_space_connectivity.html', # noqa E501
Expand Down
3 changes: 2 additions & 1 deletion doc/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ Datasets
refmeg_noise.data_path
ssvep.data_path
erp_core.data_path
epilepsy_ecog.data_path
epilepsy_ecog.data_path
eyelink.data_path
13 changes: 13 additions & 0 deletions doc/overview/datasets_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,19 @@ standard.

* :ref:`tut-ssvep`

EYELINK
=======
:func:`mne.datasets.eyelink.data_path`

A small example dataset in SR research's proprietary .asc format.
1 participant fixated on the screen while short light flashes appeared.
Monocular recording of gaze position and pupil size, 1000 Hz sampling
frequency.

.. topic:: Examples

* :ref:`tut-eyetrack`

References
==========

Expand Down
13 changes: 13 additions & 0 deletions doc/preprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ Projections:
make_montage_volume
warp_montage

:py:mod:`mne.preprocessing.eyetracking`:

.. currentmodule:: mne.preprocessing.eyetracking

.. automodule:: mne.preprocessing.eyetracking
:no-members:
:no-inherited-members:

.. autosummary::
:toctree: generated/

set_channel_types_eyetrack

EEG referencing:

.. currentmodule:: mne
Expand Down
1 change: 1 addition & 0 deletions doc/reading_raw_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Reading raw data
read_raw_ctf
read_raw_curry
read_raw_edf
read_raw_eyelink
read_raw_bdf
read_raw_gdf
read_raw_kit
Expand Down
18 changes: 12 additions & 6 deletions mne/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ def equalize_channels(instances, copy=True, verbose=None):
FIFF.FIFF_UNIT_MOL: 'M',
FIFF.FIFF_UNIT_NONE: 'NA',
FIFF.FIFF_UNIT_CEL: 'C',
FIFF.FIFF_UNIT_S: 'S'}
FIFF.FIFF_UNIT_S: 'S',
FIFF.FIFF_UNIT_PX: 'px'}


def _check_set(ch, projs, ch_type):
Expand Down Expand Up @@ -331,7 +332,8 @@ def set_channel_types(self, mapping, verbose=None):

ecg, eeg, emg, eog, exci, ias, misc, resp, seeg, dbs, stim, syst,
ecog, hbo, hbr, fnirs_cw_amplitude, fnirs_fd_ac_amplitude,
fnirs_fd_phase, fnirs_od, temperature, gsr
fnirs_fd_phase, fnirs_od, eyetrack_pos, eyetrack_pupil,
temperature, gsr

.. versionadded:: 0.9.0
"""
Expand Down Expand Up @@ -379,6 +381,10 @@ def set_channel_types(self, mapping, verbose=None):
coil_type = FIFF.FIFFV_COIL_FNIRS_FD_PHASE
elif ch_type == 'fnirs_od':
coil_type = FIFF.FIFFV_COIL_FNIRS_OD
elif ch_type == 'eyetrack_pos':
coil_type = FIFF.FIFFV_COIL_EYETRACK_POS
elif ch_type == 'eyetrack_pupil':
coil_type = FIFF.FIFFV_COIL_EYETRACK_PUPIL
else:
coil_type = FIFF.FIFFV_COIL_NONE
self.info['chs'][c_ind]['coil_type'] = coil_type
Expand Down Expand Up @@ -595,7 +601,7 @@ def pick_types(self, meg=False, eeg=False, stim=False, eog=False,
resp=False, chpi=False, exci=False, ias=False, syst=False,
seeg=False, dipole=False, gof=False, bio=False,
ecog=False, fnirs=False, csd=False, dbs=False,
temperature=False, gsr=False,
temperature=False, gsr=False, eyetrack=False,
include=(), exclude='bads', selection=None, verbose=None):
"""Pick some channels by type and names.

Expand All @@ -621,9 +627,9 @@ def pick_types(self, meg=False, eeg=False, stim=False, eog=False,
self.info, meg=meg, eeg=eeg, stim=stim, eog=eog, ecg=ecg, emg=emg,
ref_meg=ref_meg, misc=misc, resp=resp, chpi=chpi, exci=exci,
ias=ias, syst=syst, seeg=seeg, dipole=dipole, gof=gof, bio=bio,
ecog=ecog, fnirs=fnirs, csd=csd, dbs=dbs, include=include,
exclude=exclude, selection=selection, temperature=temperature,
gsr=gsr)
ecog=ecog, fnirs=fnirs, csd=csd, dbs=dbs, temperature=temperature,
gsr=gsr, eyetrack=eyetrack, include=include, exclude=exclude,
selection=selection)

self._pick_drop_channels(idx)

Expand Down
3 changes: 2 additions & 1 deletion mne/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from . import ssvep
from . import erp_core
from . import epilepsy_ecog
from . import eyelink
from . import ucl_opm_auditory
from ._fetch import fetch_dataset
from .utils import (_download_all_example_data, fetch_hcp_mmp_parcellation,
Expand All @@ -42,5 +43,5 @@
'sleep_physionet', 'somato', 'spm_face', 'ssvep', 'testing',
'visual_92_categories', 'limo', 'erp_core', 'epilepsy_ecog',
'fetch_dataset', 'fetch_phantom', 'has_dataset', 'refmeg_noise',
'fnirs_motor'
'fnirs_motor', 'eyelink'
]
15 changes: 12 additions & 3 deletions mne/datasets/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# respective repos, and make a new release of the dataset on GitHub. Then
# update the checksum in the MNE_DATASETS dict below, and change version
# here: ↓↓↓↓↓ ↓↓↓
RELEASES = dict(testing='0.142', misc='0.24')
RELEASES = dict(testing='0.144', misc='0.26')
TESTING_VERSIONED = f'mne-testing-data-{RELEASES["testing"]}'
MISC_VERSIONED = f'mne-misc-data-{RELEASES["misc"]}'

Expand All @@ -111,7 +111,7 @@
# Testing and misc are at the top as they're updated most often
MNE_DATASETS['testing'] = dict(
archive_name=f'{TESTING_VERSIONED}.tar.gz',
hash='md5:44b857ddb34aefd752e4f5b19d625dee',
hash='md5:fb546f44dba3310945225ed8fdab4a91',
url=('https://codeload.github.com/mne-tools/mne-testing-data/'
f'tar.gz/{RELEASES["testing"]}'),
# In case we ever have to resort to osf.io again...
Expand All @@ -123,7 +123,7 @@
)
MNE_DATASETS['misc'] = dict(
archive_name=f'{MISC_VERSIONED}.tar.gz', # 'mne-misc-data',
hash='md5:eb017a919939511932bd683f26f97490',
hash='md5:868b484fadd73b1d1a3535b7194a0d03',
url=('https://codeload.github.com/mne-tools/mne-misc-data/tar.gz/'
f'{RELEASES["misc"]}'),
folder_name='MNE-misc-data',
Expand Down Expand Up @@ -335,3 +335,12 @@
folder_name='foo',
config_key='MNE_DATASETS_FAKE_PATH'
)

# eyelink dataset
MNE_DATASETS['eyelink'] = dict(
archive_name='eyelink_example_data.zip',
hash='md5:081950c05f35267458d9c751e178f161',
url=('https://osf.io/r5ndq/download?version=1'),
folder_name='eyelink-example-data',
config_key='MNE_DATASETS_EYELINK_PATH'
)
3 changes: 3 additions & 0 deletions mne/datasets/eyelink/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Eyelink test dataset."""

from .eyelink import data_path, get_version
26 changes: 26 additions & 0 deletions mne/datasets/eyelink/eyelink.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Authors: Dominik Welke <[email protected]>
# License: BSD Style.

from ...utils import verbose
from ..utils import (_data_path_doc, _get_version, _version_doc,
_download_mne_dataset)


@verbose
def data_path(path=None, force_update=False, update_path=True,
download=True, *, verbose=None): # noqa: D103
return _download_mne_dataset(
name='eyelink', processor='unzip', path=path,
force_update=force_update, update_path=update_path,
download=download)


data_path.__doc__ = _data_path_doc.format(name='eyelink',
conf='MNE_DATASETS_EYELINK_PATH')


def get_version(): # noqa: D103
return _get_version('eyelink')


get_version.__doc__ = _version_doc.format(name='eyelink')
3 changes: 2 additions & 1 deletion mne/datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def _download_all_example_data(verbose=True):
kiloword, phantom_4dbti, sleep_physionet, limo,
fnirs_motor, refmeg_noise, fetch_infant_template,
fetch_fsaverage, ssvep, erp_core, epilepsy_ecog,
fetch_phantom, ucl_opm_auditory)
fetch_phantom, eyelink, ucl_opm_auditory)
sample_path = sample.data_path()
testing.data_path()
misc.data_path()
Expand All @@ -327,6 +327,7 @@ def _download_all_example_data(verbose=True):
brainstorm.bst_resting.data_path(accept=True)
phantom_path = brainstorm.bst_phantom_elekta.data_path(accept=True)
fetch_phantom('otaniemi', subjects_dir=phantom_path)
eyelink.data_path()
brainstorm.bst_phantom_ctf.data_path(accept=True)
eegbci.load_data(1, [6, 10, 14], update_path=True)
for subj in range(4):
Expand Down
19 changes: 13 additions & 6 deletions mne/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@
dipole='k', gof='k', bio='k', ecog='k', hbo='#AA3377', hbr='b',
fnirs_cw_amplitude='k', fnirs_fd_ac_amplitude='k',
fnirs_fd_phase='k', fnirs_od='k', csd='k', whitened='k',
gsr='#666633', temperature='#663333'),
gsr='#666633', temperature='#663333',
eyegaze='k', pupil='k'),
si_units=dict(mag='T', grad='T/m', eeg='V', eog='V', ecg='V', emg='V',
misc='AU', seeg='V', dbs='V', dipole='Am', gof='GOF',
bio='V', ecog='V', hbo='M', hbr='M', ref_meg='T',
fnirs_cw_amplitude='V', fnirs_fd_ac_amplitude='V',
fnirs_fd_phase='rad', fnirs_od='V', csd='V/m²',
whitened='Z', gsr='S', temperature='C'),
whitened='Z', gsr='S', temperature='C',
eyegaze='AU', pupil='AU'),
units=dict(mag='fT', grad='fT/cm', eeg='µV', eog='µV', ecg='µV', emg='µV',
misc='AU', seeg='mV', dbs='µV', dipole='nAm', gof='GOF',
bio='µV', ecog='µV', hbo='µM', hbr='µM', ref_meg='fT',
fnirs_cw_amplitude='V', fnirs_fd_ac_amplitude='V',
fnirs_fd_phase='rad', fnirs_od='V', csd='mV/m²',
whitened='Z', gsr='S', temperature='C'),
whitened='Z', gsr='S', temperature='C',
eyegaze='AU', pupil='AU'),
# scalings for the units
scalings=dict(mag=1e15, grad=1e13, eeg=1e6, eog=1e6, emg=1e6, ecg=1e6,
misc=1.0, seeg=1e3, dbs=1e6, ecog=1e6, dipole=1e9, gof=1.0,
bio=1e6, hbo=1e6, hbr=1e6, ref_meg=1e15,
fnirs_cw_amplitude=1.0, fnirs_fd_ac_amplitude=1.0,
fnirs_fd_phase=1., fnirs_od=1.0, csd=1e3, whitened=1.,
gsr=1., temperature=1.),
gsr=1., temperature=1., eyegaze=1., pupil=1.),
# rough guess for a good plot
scalings_plot_raw=dict(mag=1e-12, grad=4e-11, eeg=20e-6, eog=150e-6,
ecg=5e-4, emg=1e-3, ref_meg=1e-12, misc='auto',
Expand All @@ -42,13 +45,15 @@
fnirs_fd_ac_amplitude=2e-2, fnirs_fd_phase=2e-1,
fnirs_od=2e-2, csd=200e-4,
dipole=1e-7, gof=1e2,
gsr=1., temperature=0.1),
gsr=1., temperature=0.1,
eyegaze=3e-1, pupil=1e3),
scalings_cov_rank=dict(mag=1e12, grad=1e11, eeg=1e5, # ~100x scalings
seeg=1e1, dbs=1e4, ecog=1e4, hbo=1e4, hbr=1e4),
ylim=dict(mag=(-600., 600.), grad=(-200., 200.), eeg=(-200., 200.),
misc=(-5., 5.), seeg=(-20., 20.), dbs=(-200., 200.),
dipole=(-100., 100.), gof=(0., 1.), bio=(-500., 500.),
ecog=(-200., 200.), hbo=(0, 20), hbr=(0, 20), csd=(-50., 50.)),
ecog=(-200., 200.), hbo=(0, 20), hbr=(0, 20), csd=(-50., 50.),
eyegaze=(0., 5000.), pupil=(0., 5000.)),
titles=dict(mag='Magnetometers', grad='Gradiometers', eeg='EEG', eog='EOG',
ecg='ECG', emg='EMG', misc='misc', seeg='sEEG', dbs='DBS',
bio='BIO', dipole='Dipole', ecog='ECoG', hbo='Oxyhemoglobin',
Expand All @@ -60,6 +65,8 @@
gof='Goodness of fit', csd='Current source density',
stim='Stimulus', gsr='Galvanic skin response',
temperature='Temperature',
eyegaze='Eye-tracking (Gaze position)',
pupil='Eye-tracking (Pupil size)',
),
mask_params=dict(marker='o',
markerfacecolor='w',
Expand Down
1 change: 1 addition & 0 deletions mne/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
read_evoked_fieldtrip)
from .nihon import read_raw_nihon
from ._read_raw import read_raw
from .eyelink import read_raw_eyelink


# for backward compatibility
Expand Down
15 changes: 14 additions & 1 deletion mne/io/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
FIFF.FIFFV_FNIRS_CH = 1100 # Functional near-infrared spectroscopy
FIFF.FIFFV_TEMPERATURE_CH = 1200 # Functional near-infrared spectroscopy
FIFF.FIFFV_GALVANIC_CH = 1300 # Galvanic skin response
FIFF.FIFFV_EYETRACK_CH = 1400 # Eye-tracking

_ch_kind_named = {key: key for key in (
FIFF.FIFFV_BIO_CH,
FIFF.FIFFV_MEG_CH,
Expand All @@ -227,6 +229,7 @@
FIFF.FIFFV_FNIRS_CH,
FIFF.FIFFV_GALVANIC_CH,
FIFF.FIFFV_TEMPERATURE_CH,
FIFF.FIFFV_EYETRACK_CH
)}

#
Expand Down Expand Up @@ -854,6 +857,8 @@
FIFF.FIFF_UNIT_AM = 202 # Am
FIFF.FIFF_UNIT_AM_M2 = 203 # Am/m^2
FIFF.FIFF_UNIT_AM_M3 = 204 # Am/m^3

FIFF.FIFF_UNIT_PX = 210 # Pixel
_ch_unit_named = {key: key for key in(
FIFF.FIFF_UNIT_NONE, FIFF.FIFF_UNIT_UNITLESS, FIFF.FIFF_UNIT_M,
FIFF.FIFF_UNIT_KG, FIFF.FIFF_UNIT_SEC, FIFF.FIFF_UNIT_A, FIFF.FIFF_UNIT_K,
Expand All @@ -865,6 +870,7 @@
FIFF.FIFF_UNIT_CEL, FIFF.FIFF_UNIT_LM, FIFF.FIFF_UNIT_LX,
FIFF.FIFF_UNIT_V_M2, FIFF.FIFF_UNIT_T_M, FIFF.FIFF_UNIT_AM,
FIFF.FIFF_UNIT_AM_M2, FIFF.FIFF_UNIT_AM_M3,
FIFF.FIFF_UNIT_PX,
)}
#
# Multipliers
Expand Down Expand Up @@ -916,6 +922,11 @@
FIFF.FIFFV_COIL_FNIRS_FD_AC_AMPLITUDE = 304 # fNIRS frequency domain AC amplitude
FIFF.FIFFV_COIL_FNIRS_FD_PHASE = 305 # fNIRS frequency domain phase
FIFF.FIFFV_COIL_FNIRS_RAW = FIFF.FIFFV_COIL_FNIRS_CW_AMPLITUDE # old alias
FIFF.FIFFV_COIL_FNIRS_TD_GATED_AMPLITUDE = 306 # fNIRS time-domain gated amplitude
FIFF.FIFFV_COIL_FNIRS_TD_MOMENTS_AMPLITUDE = 307 # fNIRS time-domain moments amplitude

FIFF.FIFFV_COIL_EYETRACK_POS = 400 # Eye-tracking gaze position
FIFF.FIFFV_COIL_EYETRACK_PUPIL = 401 # Eye-tracking pupil size

FIFF.FIFFV_COIL_MCG_42 = 1000 # For testing the MCG software

Expand Down Expand Up @@ -1002,7 +1013,9 @@
FIFF.FIFFV_COIL_DIPOLE, FIFF.FIFFV_COIL_FNIRS_HBO,
FIFF.FIFFV_COIL_FNIRS_HBR, FIFF.FIFFV_COIL_FNIRS_RAW,
FIFF.FIFFV_COIL_FNIRS_OD, FIFF.FIFFV_COIL_FNIRS_FD_AC_AMPLITUDE,
FIFF.FIFFV_COIL_FNIRS_FD_PHASE, FIFF.FIFFV_COIL_MCG_42,
FIFF.FIFFV_COIL_FNIRS_FD_PHASE, FIFF.FIFFV_COIL_FNIRS_TD_GATED_AMPLITUDE,
FIFF.FIFFV_COIL_FNIRS_TD_MOMENTS_AMPLITUDE, FIFF.FIFFV_COIL_MCG_42,
FIFF.FIFFV_COIL_EYETRACK_POS, FIFF.FIFFV_COIL_EYETRACK_PUPIL,
FIFF.FIFFV_COIL_POINT_MAGNETOMETER, FIFF.FIFFV_COIL_AXIAL_GRAD_5CM,
FIFF.FIFFV_COIL_VV_PLANAR_W, FIFF.FIFFV_COIL_VV_PLANAR_T1,
FIFF.FIFFV_COIL_VV_PLANAR_T2, FIFF.FIFFV_COIL_VV_PLANAR_T3,
Expand Down
7 changes: 7 additions & 0 deletions mne/io/eyelink/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Module for loading Eye-Tracker data."""

# Author: Dominik Welke <[email protected]>
#
# License: BSD-3-Clause

from .eyelink import read_raw_eyelink
Loading