Reference to channel(s) - if more than one channel is used as reference, the average of these channels is used:
reference_ce!(eeg, ch=[1, 2])
reference_ce!(eeg, ch=2:4)
reference_ce!(eeg, ch=18)
Reference to common average:
reference_avg!(eeg)
# do not include current electrode and Fp1, Fp2, O1 and O2 when calculating common average
reference_avg!(eeg, exclude_fpo=true, exclude_current=true)
Reference to ipsilateral auricular electrodes:
reference_a!(eeg, type=:i)
Reference to contralateral mastoid electrodes:
reference_m!(eeg, type=:c)
Reference using planar Laplacian:
= reference_avg(eeg)
eeg_avg = plot_topo(eeg_avg, seg=(12, 14), title="AVG",)
p1 = reference_avg(eeg, weighted=true)
eeg_wavg = plot_topo(eeg_avg, seg=(12, 14), title="WAVG",)
p2 = reference_plap(eeg, nn=4, weighted=false)
eeg_lap = plot_topo(eeg_lap, seg=(12, 14), title="Laplacian (4)")
p3 = reference_plap(eeg, nn=4, weighted=true)
eeg_lap = plot_topo(eeg_lap, seg=(12, 14), title="weighted Laplacian (4)")
p4 = plot(p1, p2, p3, p4, layout=(2,2))
p plot_save(p, file_name="images/lap4.png")
(!) Planar Laplacian referencing required electrode locations.
Custom referencing, e.g. bipolar longitudinal:
= reference_custom(eeg, ref_list=["Fz-Cz", "Cz-Pz", "Fp1-F7", "Fp1-F3", "F7-T3", "T3-T5", "T5-O1", "F3-C3", "C3-P3", "P3-O1", "Fp2-F8", "Fp2-F4", "F8-T4", "T4-T6", "T6-O2", "F4-C4", "C4-P4", "P4-O2"], ref_name="longitudinal-BIP")
eeg_bipl info(eeg_bipl)
Output:
Data type: EEG
File format: EDF
Source file: ~/.julia/artifacts/25cbd5d6479ab71d126b918e5b7eefa495dface0/test-files/eeg-test-edf.edf
File size [MB]: 14.19
Memory size [MB]: 59.09
Subject:
Recording: EEGDigiTrack EEG-1042 (42-channel EEG Amplifier) V0.5 Rev. 41
Recording notes:
Recording date: 25.04.22
Recording time: 09.31.41
Sampling rate (Hz): 256
Signal length [samples]: 309760
Signal length [seconds]: 1210.0
Number of channels: 23
Number of epochs: 1
Epoch length [samples]: 309760
Epoch length [seconds]: 1210.0
Reference type: longitudinal-BIP
Labels: yes
Markers: no
Channel locations: no
Components: no
Channels:
ch label type unit
1 Fz-Cz EEG μV
2 Cz-Pz EEG μV
3 Fp1-F7 EEG μV
4 Fp1-F3 EEG μV
5 F7-T3 EEG μV
6 T3-T5 EEG μV
7 T5-O1 EEG μV
8 F3-C3 EEG μV
9 C3-P3 EEG μV
10 P3-O1 EEG μV
11 Fp2-F8 EEG μV
12 Fp2-F4 EEG μV
13 F8-T4 EEG μV
14 T4-T6 EEG μV
15 T6-O2 EEG μV
16 F4-C4 EEG μV
17 C4-P4 EEG μV
18 P4-O2 EEG μV
19 A1 REF μV
20 A2 REF μV
21 EOG1 EOG μV
22 EOG2 EOG μV
23 ECG ECG mV
Examples of other montages:
["Fp2-Fp1", "F8-Fp2", "F8-F4", "F4-Fz", "Fz-F3", "F3-F7", "Fp1-F7", "T4-C4", "C4-Cz", "Cz-C3", "C3-T3", "T6-P4", "P4-Pz", "Pz-P3", "P3-T5", "O2-O1"]
,
"transverse-BIP"
["Fz", "Cz", "Pz", "Fp1-F7", "Fp1-F3", "F7-T3", "T3-T5", "T5-O1", "F3-C3", "C3-P3", "P3-O1", "Fp2-F8", "Fp2-F4", "F8-T4", "T4-T6", "T6-O2", "F4-C4", "C4-P4", "P4-O2"]
,
"longitudinal-BIP"
["Fp-Fz", "Fz-Cz", "Cz-Pz", "Pz-O", "Fp1-F7", "Fp1-F3", "F7-T7", "T7-P7", "P7-O1", "F3-C3", "C3-P3", "P3-O1", "Fp1-F7", "Fp2-F4", "F8-T8", "T8-P8", "P8-O2", "F4-C4", "C4-P4", "P4-O2"]
,
"longitudinal-BIP"
Custom montages may be loaded from a file:
= import_montage(joinpath(NeuroAnalyzer.PATH, "montages", "bip_long.mnt"))
ref_l, ref_n reference_custom(eeg, ref_listref_l, ref_name=ref_n)
Example montage files are located in the montages/
folder.
(!) The structure of the montage file is:
longitudinal-BIP
Fz-Cz
or Fp1
Each channel/channel pair must be in a separate line
Edit already exiting montage:
edit_montage("montages/bip_long.mnt")
(!) This will open the .mnt file in the OS editor.