8000 MRG+1: GDF support (#4205) · mne-tools/mne-python@d130b74 · GitHub
[go: up one dir, main page]

Skip to content

Commit d130b74

Browse files
nbaralarsoner
authored andcommitted
MRG+1: GDF support (#4205)
* WIP: add basic GDF1 and GDF2 support only tested on a few GDF test files doesn't break existing EDF tests * Remove \x00 from channel names * Fix data calibration - Unified offset and calibration values for EDF/BDF/GDF modules - few PEP8 fixes - TODO: GDF 2.x triggers are detected as multiples of 256 - TODO: overflow and saturation detection * Proper imports imports in test_gdf.py * Fix to test_edf.py An additional warning has been added in edf.py when Lowpass information is not available in file header. As a result test_stim_channel() would fail. The test should now expect 2 warnings. * Separated EDF and GDF code - EDF and GDF file headers are now read in their own private subfunction - some PEP8 and cosmetic changes - GDF events are still multiples of 256 * Add biosig GDF test file make Travis happy * python3 fixes - python3 requires decoding the bytes objects to produce strings - np.unique() fails for dtype=object in python3 (see numpy/numpy#641) - flake, pydocstyle * Read biosemi GDF stim_channel properly * Speed up reading from file - fromstring -> fromfile * Test routines and added safechecks Also remove test datafiles (see mne-tools/mne-testing-data#23) * Update utils, and missing lowpass info no longer issues warning * Added stim_channel argument check * Address comments * Address comments and update doc * Address comments * Docstyle
1 parent db38c67 commit d130b74

File tree

4 files cha 8000 nged

+728
-151
lines changed

4 files changed

+728
-151
lines changed

doc/manual/io.rst

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ EEG Brainvision .vhdr :func:`mne.io.read_r
2323
EEG Neuroscan CNT .cnt :func:`mne.io.read_raw_cnt`
2424
EEG European data format .edf :func:`mne.io.read_raw_edf`
2525
EEG Biosemi data format .bdf :func:`mne.io.read_raw_edf`
26+
EEG General data format .gdf :func:`mne.io.read_raw_edf`
2627
EEG EGI simple binary .egi :func:`mne.io.read_raw_egi`
2728
EEG EEGLAB .set :func:`mne.io.read_raw_eeglab` and :func:`mne.read_epochs_eeglab`
2829
Electrode locations elc, txt, csd, sfp, htps Misc :func:`mne.channels.read_montage`
@@ -262,26 +263,37 @@ European data format (.edf)
262263

263264
EDF and EDF+ files can be read in using :func:`mne.io.read_raw_edf`.
264265

265-
http://www.edfplus.info/specs/edf.html
266+
`EDF (European Data Format) <http://www.edfplus.info/specs/edf.html>`_ and
267+
`EDF+ <http://www.edfplus.info/specs/edfplus.html>`_ are 16-bit formats.
266268

267-
EDF (European Data Format) and EDF+ are 16-bit formats
268-
http://www.edfplus.info/specs/edfplus.html
269-
270-
The EDF+ files may contain an annotation channel which can
271-
be used to store trigger information. The Time-stamped Annotation
272-
Lists (TALs) on the annotation data can be converted to a trigger
273-
channel (STI 014) using an annotation map file which associates
274-
an annotation label with a number on the trigger channel.
269+
The EDF+ files may contain an annotation channel which can be used to store
270+
trigger information. The Time-stamped Annotation Lists (TALs) on the
271+
annotation data can be converted to a trigger channel (STI 014) using an
272+
annotation map file which associates an annotation label with a number on
273+
the trigger channel.
275274

276275
Biosemi data format (.bdf)
277276
==========================
278277

279-
The BDF format (http://www.biosemi.com/faq/file_format.htm) is a 24-bit variant
280-
of the EDF format used by the EEG systems manufactured by a company called
281-
BioSemi. It can also be read in using :func:`mne.io.read_raw_edf`.
278+
The `BDF format <http://www.biosemi.com/faq/file_format.htm>`_ is a 24-bit
279+
variant of the EDF format used by the EEG systems manufactured by a company
280+
called BioSemi. It can also be read in using :func:`mne.io.read_raw_edf`.
282281

283282
.. warning:: The data samples in a BDF file are represented in a 3-byte (24-bit) format. Since 3-byte raw data buffers are not presently supported in the fif format these data will be changed to 4-byte integers in the conversion.
284283

284+
General data format (.gdf)
285+
==========================
286+
287+
GDF files can be read in using :func:`mne.io.read_raw_edf`.
288+
289+
`GDF (General Data Format) <https://arxiv.org/abs/cs/0608052>`_ is a flexible
290+
format for biomedical signals, that overcomes some of the limitations of the
291+
EDF format. The original specification (GDF v1) includes a binary header,
292+
and uses an event table. An updated specification (GDF v2) was released in
293+
2011 and adds fields for additional subject-specific information (gender,
294+
age, etc.) and allows storing several physical units and other properties.
295+
Both specifications are supported in MNE.
296+
285297
Neuroscan CNT data format (.cnt)
286298
================================
287299

mne/datasets/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _data_path(path=None, force_update=False, update_path=True, download=True,
< 8000 /code>
228228
path = _get_path(path, key, name)
229229
# To update the testing or misc dataset, push commits, then make a new
230230
# release on GitHub. Then update the "releases" variable:
231-
releases = dict(testing='0.32', misc='0.3')
231+
releases = dict(testing='0.33', misc='0.3')
232232
# And also update the "hashes['testing']" variable below.
233233

234234
# To update any other dataset, update the data archive itself (upload
@@ -285,7 +285,7 @@ def _data_path(path=None, force_update=False, update_path=True, download=True,
285285
sample='1d5da3a809fded1ef5734444ab5bf857',
286286
somato='f3e3a8441477bb5bacae1d0c6e0964fb',
287287
spm='f61041e3f3f2ba0def8a2ca71592cc41',
288-
testing='bcda2bb49dfa8a9400aaeeb3c4b0a072',
288+
testing='37e965395f04ed357605e796fde104f3',
289289
multimodal='26ec847ae9ab80f58f204d09e2c08367',
290290
visual_92_categories='46c7e590f4a48596441ce001595d5e58',
291291
mtrf='273a390ebbc48da2c3184b01a82e4636',

0 commit comments

Comments
 (0)
0