diff --git a/mne_bids/tests/data/ieeg_bids/README b/mne_bids/tests/data/ieeg_bids/README new file mode 100644 index 000000000..2e275e44f --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/README @@ -0,0 +1,6 @@ +References +---------- +Appelhoff, S., Sanderson, M., Brooks, T., Vliet, M., Quentin, R., Holdgraf, C., Chaumon, M., Mikulan, E., Tavabi, K., Höchenberger, R., Welke, D., Brunner, C., Rockhill, A., Larson, E., Gramfort, A. and Jas, M. (2019). MNE-BIDS: Organizing electrophysiological data into the BIDS format and facilitating their analysis. Journal of Open Source Software 4: (1896). https://doi.org/10.21105/joss.01896 + +Holdgraf, C., Appelhoff, S., Bickel, S., Bouchard, K., D'Ambrosio, S., David, O., … Hermes, D. (2019). iEEG-BIDS, extending the Brain Imaging Data Structure specification to human intracranial electrophysiology. Scientific Data, 6, 102. https://doi.org/10.1038/s41597-019-0105-7 + diff --git a/mne_bids/tests/data/ieeg_bids/dataset_description.json b/mne_bids/tests/data/ieeg_bids/dataset_description.json new file mode 100644 index 000000000..fc0939c71 --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/dataset_description.json @@ -0,0 +1,8 @@ +{ + "Name": " ", + "BIDSVersion": "1.6.0", + "DatasetType": "raw", + "Authors": [ + "[Unspecified]" + ] +} diff --git a/mne_bids/tests/data/ieeg_bids/participants.json b/mne_bids/tests/data/ieeg_bids/participants.json new file mode 100644 index 000000000..de061dfc2 --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/participants.json @@ -0,0 +1,24 @@ +{ + "participant_id": { + "Description": "Unique participant identifier" + }, + "age": { + "Description": "Age of the participant at time of testing", + "Units": "years" + }, + "sex": { + "Description": "Biological sex of the participant", + "Levels": { + "F": "female", + "M": "male" + } + }, + "hand": { + "Description": "Handedness of the participant", + "Levels": { + "R": "right", + "L": "left", + "A": "ambidextrous" + } + } +} diff --git a/mne_bids/tests/data/ieeg_bids/participants.tsv b/mne_bids/tests/data/ieeg_bids/participants.tsv new file mode 100644 index 000000000..9af3285e4 --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/participants.tsv @@ -0,0 +1,2 @@ +participant_id age sex hand +sub-01 n/a n/a n/a diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_space-MNI152NLin2009bAsym_coordsystem.json b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_space-MNI152NLin2009bAsym_coordsystem.json new file mode 100644 index 000000000..09f8b98e7 --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_space-MNI152NLin2009bAsym_coordsystem.json @@ -0,0 +1,5 @@ +{ + "iEEGCoordinateSystem": "MNI152NLin2009bAsym", + "iEEGCoordinateSystemDescription": "mni", + "iEEGCoordinateUnits": "mm" +} diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_space-MNI152NLin2009bAsym_electrodes.tsv b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_space-MNI152NLin2009bAsym_electrodes.tsv new file mode 100644 index 000000000..086775e6f --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_space-MNI152NLin2009bAsym_electrodes.tsv @@ -0,0 +1,11 @@ +name x y z type +ECOG_0 22.5 -38.5 83.0 ECOG +ECOG_1 28.0 -29.0 81.5 ECOG +ECOG_2 32.0 -19.5 78.0 ECOG +ECOG_3 37.0 -10.5 73.5 ECOG +ECOG_4 40.5 -2.0 69.5 ECOG +ECOG_5 42.5 6.5 63.0 ECOG +ECOG_6 45.5 13.5 55.5 ECOG +ECOG_7 48.0 22.5 48.5 ECOG +ECOG_8 45.5 13.5 55.5 ECOG +ECOG_9 48.0 22.5 48.5 ECOG diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_channels.tsv b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_channels.tsv new file mode 100644 index 000000000..8921125f0 --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_channels.tsv @@ -0,0 +1,11 @@ +name type units low_cutoff high_cutoff description sampling_frequency status status_description +ECOG_0 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_1 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_2 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_3 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_4 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_5 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_6 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_7 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_8 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a +ECOG_9 ECOG µV 0.0 500.0 Electrocorticography 1000.0 good n/a diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.eeg b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.eeg new file mode 100644 index 000000000..6cb39f251 Binary files /dev/null and b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.eeg differ diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.json b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.json new file mode 100644 index 000000000..db231bfc2 --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.json @@ -0,0 +1,18 @@ +{ + "TaskName": "audiovisual", + "Manufacturer": "BrainProducts", + "PowerLineFrequency": "n/a", + "SamplingFrequency": 1000.0, + "SoftwareFilters": "n/a", + "RecordingDuration": 0.999, + "RecordingType": "continuous", + "iEEGReference": "n/a", + "ECOGChannelCount": 10, + "SEEGChannelCount": 0, + "EEGChannelCount": 0, + "EOGChannelCount": 0, + "ECGChannelCount": 0, + "EMGChannelCount": 0, + "MiscChannelCount": 0, + "TriggerChannelCount": 0 +} diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.vhdr b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.vhdr new file mode 100644 index 000000000..701f069c1 --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.vhdr @@ -0,0 +1,35 @@ +Brain Vision Data Exchange Header File Version 1.0 +; Written using pybv 0.6.0 + +[Common Infos] +Codepage=UTF-8 +DataFile=sub-01_ses-01_task-audiovisual_run-01_ieeg.eeg +MarkerFile=sub-01_ses-01_task-audiovisual_run-01_ieeg.vmrk +DataFormat=BINARY +; Data orientation: MULTIPLEXED=ch1,pt1, ch2,pt1 ... +DataOrientation=MULTIPLEXED +NumberOfChannels=10 +; Sampling interval in microseconds +SamplingInterval=1000.0 + +[Binary Infos] +BinaryFormat=IEEE_FLOAT_32 + +[Channel Infos] +; Each entry: Ch=,, +; ,, Future extensions.. +; Fields are delimited by commas, some fields might be omitted (empty). +; Commas in channel names are coded as "\1". +Ch1=ECOG_0,,0.1,µV +Ch2=ECOG_1,,0.1,µV +Ch3=ECOG_2,,0.1,µV +Ch4=ECOG_3,,0.1,µV +Ch5=ECOG_4,,0.1,µV +Ch6=ECOG_5,,0.1,µV +Ch7=ECOG_6,,0.1,µV +Ch8=ECOG_7,,0.1,µV +Ch9=ECOG_8,,0.1,µV +Ch10=ECOG_9,,0.1,µV + +[Comment] + diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.vmrk b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.vmrk new file mode 100644 index 000000000..40c1fb0ee --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.vmrk @@ -0,0 +1,13 @@ +Brain Vision Data Exchange Marker File, Version 1.0 +;Exported using pybv 0.6.0 + +[Common Infos] +Codepage=UTF-8 +DataFile=sub-01_ses-01_task-audiovisual_run-01_ieeg.eeg + +[Marker Infos] +; Each entry: Mk=,,, +; , +; +; Fields are delimited by commas, some fields might be omitted (empty). +; Commas in type or description text are coded as "\1". diff --git a/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/sub-01_ses-01_scans.tsv b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/sub-01_ses-01_scans.tsv new file mode 100644 index 000000000..756deab1c --- /dev/null +++ b/mne_bids/tests/data/ieeg_bids/sub-01/ses-01/sub-01_ses-01_scans.tsv @@ -0,0 +1,2 @@ +filename acq_time +ieeg/sub-01_ses-01_task-audiovisual_run-01_ieeg.vhdr n/a diff --git a/mne_bids/tests/test_read.py b/mne_bids/tests/test_read.py index 64edcc793..b1495fb4f 100644 --- a/mne_bids/tests/test_read.py +++ b/mne_bids/tests/test_read.py @@ -1335,3 +1335,18 @@ def test_gsr_and_temp_reading(): raw = read_raw_bids(bids_path) assert raw.get_channel_types(['GSR']) == ['gsr'] assert raw.get_channel_types(['Temperature']) == ['temperature'] + + +def test_read_ieeg_coord_frame(): + """Ensure that the iEEG coordinate frame is read correctly.""" + bids_path = BIDSPath( + subject="01", + session="01", + task="audiovisual", + run="01", + root=Path(__file__).parent / "data" / "ieeg_bids", + ) + raw_read = read_raw_bids(bids_path) + + coord_frame = raw_read.get_montage().get_positions()["coord_frame"] + assert coord_frame == "MNI152NLin2009bAsym"