Skip to content

Commit

Permalink
Add KIT/Yokogawa/Ricoh marker coil extension: ".mrk" to allowed exten…
Browse files Browse the repository at this point in the history
…sions (#842)

* add mrk extension

* Update mne_bids/config.py

Co-authored-by: Stefan Appelhoff <[email protected]>

* changlog

* add Jean-Rémi to Authors.rst

* fix head_to_mri upstream API change

* add KIT test for MRK and CON

* update whatsnew

Co-authored-by: Stefan Appelhoff <[email protected]>
  • Loading branch information
kingjr and sappelhoff authored Jul 13, 2021
1 parent 3a45430 commit 2d8a721
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
.. _Tom Donoghue: https://github.com/TomDonoghue
.. _Richard Köhler: https://github.com/richardkoehler
.. _Sin Kim: https://github.com/AKSoo
.. _Jean-Rémi King: https://kingjr.github.io/
2 changes: 2 additions & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Authors
* `Richard Höchenberger`_
* `Adam Li`_
* `Richard Köhler`_ (new contributor)
* `Jean-Rémi King`_ (new contributor)

Detailed list of changes
~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -44,6 +45,7 @@ Enhancements
- :func:`mne_bids.write_raw_bids` gained a new parameter ``empty_room`` that allows to specify an associated empty-room recording when writing an MEG data file. This information will be stored in the ``AssociatedEmptyRoom`` field of the MEG JSON sidecar file, by `Richard Höchenberger`_ (:gh:`795`)
- Added support for the new channel type ``'dbs'`` (Deep Brain Stimulation), which was introduced in MNE-Python 0.23, by `Richard Köhler`_ (:gh:`800`)
- :func:`mne_bids.read_raw_bids` now warns in many situations when it encounters a mismatch between the channels in ``*_channels.tsv`` and the raw data, by `Richard Höchenberger`_ (:gh:`823`)
- MNE BIDS now accepts ".mrk" head digitization files used in the KIT/Yokogawa/Ricoh MEG system, by `Jean-Rémi King`_ and `Stefan Appelhoff`_ (:gh:`842`)

API and behavior changes
^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion examples/convert_mri_and_trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

import mne
from mne.datasets import sample
from mne.source_space import head_to_mri
from mne import head_to_mri

from mne_bids import (write_raw_bids, BIDSPath, write_anat, get_anat_landmarks,
get_head_mri_trans, print_dir_tree)
Expand Down
3 changes: 2 additions & 1 deletion mne_bids/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
ALLOWED_INPUT_EXTENSIONS +
['.json', '.tsv', '.tsv.gz', '.nii', '.nii.gz'] +
['.pos', '.eeg', '.vmrk'] + # extra datatype-specific metadata files.
['.dat', '.EEG'] # extra eeg extensions
['.dat', '.EEG'] + # extra eeg extensions
['.mrk'] # KIT/Yokogawa/Ricoh marker coil
)

# allowed BIDS path entities
Expand Down
19 changes: 19 additions & 0 deletions mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,25 @@ def test_kit(_bids_validate, tmpdir):
events_data=events_fname, event_id=event_id,
overwrite=True)

# check that everything works with MRK markers, and CON files
data_path = op.join(testing.data_path(download=False), 'KIT')
raw_fname = op.join(data_path, 'data_berlin.con')
hpi_fname = op.join(data_path, 'MQKIT_125.mrk')
electrode_fname = op.join(data_path, 'MQKIT_125.elp')
headshape_fname = op.join(data_path, 'MQKIT_125.hsp')
bids_root = tmpdir.mkdir("bids_kit_mrk")
kit_bids_path = _bids_path.copy().update(acquisition=None,
root=bids_root,
suffix='meg')
raw = _read_raw_kit(
raw_fname, mrk=hpi_fname, elp=electrode_fname,
hsp=headshape_fname)
write_raw_bids(raw, kit_bids_path)

_bids_validate(bids_root)
assert op.exists(bids_root / 'participants.tsv')
read_raw_bids(bids_path=kit_bids_path)


@pytest.mark.filterwarnings(warning_str['meas_date_set_to_none'])
def test_ctf(_bids_validate, tmpdir):
Expand Down

0 comments on commit 2d8a721

Please sign in to comment.