Importing
Initialize NeuroAnalyzer
using NeuroAnalyzerThe following data formats are supported:
| File Type | Extension | Notes |
|---|---|---|
| EDF | .edf | |
| EDF+ | .edf | |
| Alice EDF | .edf | |
| BDF | .bdf | |
| BDF+ | .bdf | |
| GDF | .gdf | |
| DigiTrack | .txt | |
| BrainVision | .vhdr | |
| CSV | .csv | channels × time or time × channels data tables are recognized automatically |
| EEGLAB | .set | preliminary support |
| FieldTrip | .mat | EEG, MEG, NIRS, events - preliminary support |
| FIFF | .fif or .fiff | preliminary support |
| Neuroscan | .cnt | continuous signal |
| Neuralink | .ncs | Continuously Sampled Channels (CSC) |
| Neurodata Without Borders | .nwb | |
| Extensible Data Format | .xdf | |
| NIRS | .nirs | |
| SNIRF | .snirf | |
| NIRX | .nirx | |
| DuoMAG MEP | .ascii or .m | |
| Thymatron | .png |
import_recording() is a wrapper function that selects proper importing function based on file extension:
eeg = import_recording("files/eeg.edf")
info(eeg) Data type: EEG
File format: EDF
Source file: files/eeg.edf
File size [MB]: 14.13
Memory size [MB]: 61.2
Subject: 528004 SIT 52, 20220831-122227-{d589f756-53fc-4f1b-915d-6e3b8c1560ad}
Recording: EEGDigiTrack EEG-1042 (42-channel EEG Amplifier) V0.5 Rev. 41
Recording notes:
Recording date: 31.08.22
Recording time: 12:32:53
Sampling rate (Hz): 256
Signal length [samples]: 308480
Signal length [seconds]: 1205.0
Number of channels: 24
Epochs ID:
Number of epochs: 1
Epoch length [samples]: 308480
Epoch length [seconds]: 1205.0
Reference type: physical
Line frequency: 50 Hz
Markers: no
Channel locations: yes
Number of EEG channels: 19
Channels:
ch label type unit bad
------ --------------- ----------- ------- -------
1 Fp1 EEG μV false
2 Fp2 EEG μV false
3 F3 EEG μV false
4 F4 EEG μV false
5 C3 EEG μV false
6 C4 EEG μV false
7 P3 EEG μV false
8 P4 EEG μV false
9 O1 EEG μV false
10 O2 EEG μV false
11 F7 EEG μV false
12 F8 EEG μV false
13 T3 EEG μV false
14 T4 EEG μV false
15 T5 EEG μV false
16 T6 EEG μV false
17 A1 REF μV false
18 A2 REF μV false
19 Fz EEG μV false
20 Cz EEG μV false
21 Pz EEG μV false
22 EOG1 EOG μV false
23 EOG2 EOG μV false
24 ECG ECG mV false
By default, channel types (EEG, ECG, EOG, etc.) are recognized automatically based on channel labels. This may not work for some recordings with incorrect channel names. In such cases channel type detection can be disabled using detect_type::Bool parameter:
eeg = import_recording("files/eeg.edf")
eeg.header.recording[:channel_type]24-element Vector{String}:
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"ref"
"ref"
"eeg"
"eeg"
"eeg"
"eog"
"eog"
"ecg"
eeg = import_recording("files/eeg.edf"; detect_type = false)
eeg.header.recording[:channel_type]24-element Vector{String}:
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
"eeg"
Importing EDF/EDF+:
eeg = import_edf("files/eeg-test-edf.edf")
eeg = import_edf("files/eeg-test-edfplus.edf")Importing Alice4 EDF:
eeg = import_alice4("files/eeg-test-alice4.edf")Importing BDF/BDF+:
eeg = import_recording("files/eeg-test-bdf.bdf")
eeg = import_recording("files/eeg-test-bdfplus.bdf")Importing GDF:
eeg = import_recording("files/eeg-test-gdf_1.25.gdf")
eeg = import_recording("files/eeg-test-gdf_2.20.gdf")Importing DigiTrack:
eeg = import_digitrack("files/eeg-test-digitrack.txt")Importing BrainVision (at least two files must be available: .vhdr/.ahdr and .eeg):
eeg = import_recording("files/eeg-test-bv.vhdr")
eeg = import_recording("files/eeg-test-bv.ahdr")Tip: BrainVision .eeg and .vmrk (markers, optional) files will be loaded using file names provided in .vhdr/.ahdr. All three files must be located in the same folder.
Importing CSV:
# channels × samples
eeg = import_csv("files/eeg-test_chxt.csv.gz")
# samples × channels
eeg = import_csv("files/eeg-test_txch.csv.gz")Tip: Data shape will be automatically detected.
Importing SET:
eeg = import_set("files/eeg-test-eeglab.set")Exporting
NeuroAnalyzer NEURO objects may be exported to CSV files:
export_csv(eeg, file_name = "files/eeg.csv")Tip: By default, only signals are exported.
To export header, markers and channel positions:
export_csv(eeg,
file_name = "files/eeg.csv",
header = true,
markers = true,
locs = true)Saving
NeuroAnalyzer NEURO objects are saved as HDF5 file.
All object structure (data, header, markers and channel positions) are stored in one same file.
Saving the object:
save(eeg, file_name = "files/eeg.hdf")To overwrite, set overwrite=true:
save(eeg, file_name = "files/eeg.hdf", overwrite = true)Tip: Filename extension must be .hdf
Loading
Loading NeuroAnalyzer NEURO object from HDF5:
eeg = load("files/eeg.hdf")