Skip to content

Commit

Permalink
add remaining ieeg tests: vhdr, edf, set
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Oct 18, 2018
1 parent 9c9a104 commit 38d6887
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mne_bids/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ def _read_raw(raw_fname, electrode=None, hsp=None, hpi=None, config=None,
raw = io.read_raw_cnt(raw_fname, montage=montage)

# MEF3 format
# only iEEG
elif ext == '.mef3':
raise ValueError("MEF3 format not yet supported. ",
"Please contact the MNE-BIDS developers.")

# Neurodata without borders .nwb format
# only iEEG
elif ext == '.nwb':
raise ValueError("Neurodata without borders .nwb format not yet ",
" supported. Please contact the MNE-BIDS developers.")
Expand Down
43 changes: 43 additions & 0 deletions mne_bids/tests/test_mne_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,46 @@ def test_nwb():
raw_to_bids(subject_id=subject_id, session_id=session_id, run=run,
task=task, acquisition=acq, raw_file=raw_fname,
output_path=output_path, overwrite=True, kind='ieeg')


def test_vhdr_ieeg():
"""Test raw_to_bids conversion for BrainVision data (ieeg)."""
output_path = _TempDir()
data_path = op.join(base_path, 'brainvision', 'tests', 'data')
raw_fname = op.join(data_path, 'test.vhdr')

raw_to_bids(subject_id=subject_id, session_id=session_id, run=run,
task=task, acquisition=acq, raw_file=raw_fname,
output_path=output_path, overwrite=True, kind='ieeg')

cmd = ['bids-validator', '--bep010', output_path]
run_subprocess(cmd, shell=shell)


def test_edf_ieeg():
"""Test raw_to_bids conversion for European Data Format data (ieeg)."""
output_path = _TempDir()
data_path = op.join(testing.data_path(), 'EDF')
raw_fname = op.join(data_path, 'test_reduced.edf')

raw_to_bids(subject_id=subject_id, session_id=session_id, run=run,
task=task, acquisition=acq, raw_file=raw_fname,
output_path=output_path, overwrite=True, kind='ieeg')

cmd = ['bids-validator', '--bep010', output_path]
run_subprocess(cmd, shell=shell)


def test_set_ieeg():
"""Test raw_to_bids conversion for EEGLAB data (ieeg)."""
# standalone .set file
output_path = _TempDir()
data_path = op.join(testing.data_path(), 'EEGLAB')
raw_fname = op.join(data_path, 'test_raw_onefile.set')

raw_to_bids(subject_id=subject_id, session_id=session_id, run=run,
task=task, acquisition=acq, raw_file=raw_fname,
output_path=output_path, overwrite=True, kind='ieeg')

cmd = ['bids-validator', '--bep010', output_path]
run_subprocess(cmd, shell=shell)

0 comments on commit 38d6887

Please sign in to comment.