using NeuroAnalyzer
using Plots
= load("files/eeg.hdf"); eeg
[ Info: Loaded: EEG (24 × 308480 × 1; 1204.996 s)
Load data:
using NeuroAnalyzer
using Plots
= load("files/eeg.hdf"); eeg
[ Info: Loaded: EEG (24 × 308480 × 1; 1204.996 s)
Reference to channel(s) - if more than one channel is used as reference, the average of these channels is used:
reference_ce(eeg, ch=["Fp1", "Fp2"])
NeuroAnalyzer.NEURO(NeuroAnalyzer.HEADER(Dict{Symbol, Any}(:weight => -1, :id => "", :middle_name => "", :height => -1, :head_circumference => -1, :handedness => "", :last_name => "528004 SIT 52, 20220831-122227-{d589f756-53fc-4f1b-915d-6e3b8c1560ad}", :first_name => ""), Dict{Symbol, Any}(:epoch_id => "", :channel_type => ["eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg" … "eeg", "eeg", "ref", "ref", "eeg", "eeg", "eeg", "eog", "eog", "ecg"], :label => ["Fp1-cavg", "Fp2-cavg", "F3-cavg", "F4-cavg", "C3-cavg", "C4-cavg", "P3-cavg", "P4-cavg", "O1-cavg", "O2-cavg" … "T5-cavg", "T6-cavg", "A1", "A2", "Fz-cavg", "Cz-cavg", "Pz-cavg", "EOG1", "EOG2", "ECG"], :prefiltering => ["HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz" … "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz"], :gain => [0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218 … 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218], :data_type => "eeg", :recording_notes => "", :recording_date => "31.08.22", :sampling_rate => 256, :file_type => "EDF"…), Dict(:name => "", :design => "", :notes => "")), [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [-0.026781055810859655 76.23199030900952 … -2.9365797200761 0.0001212274012369341; 0.026781055810859655 -76.23199030900952 … 2.9365797200761 -0.0001212274012369341; … ; -0.022184604323419066 127.03733086748798 … -0.6385598239986807 0.0008236881401195717; -0.055585528301492104 530.00037195304 … -8.80813398237423 0.0018241535887852933;;;], Dict{Any, Any}(), 0×5 DataFrame Row │ id start length description channel │ String Float64 Float64 String Int64 ─────┴────────────────────────────────────────────────, 23×9 DataFrame Row │ label loc_radius loc_theta loc_x loc_y loc_z loc_radius_sp ⋯ │ String Float64 Float64 Float64 Float64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── 1 │ Fp1 1.0 108.0 -0.31 0.95 -0.03 1.0 ⋯ 2 │ Fp2 1.0 72.0 0.31 0.95 -0.03 1.0 3 │ F7 1.0 144.0 -0.81 0.59 -0.03 1.0 4 │ F3 0.65 129.0 -0.55 0.67 0.5 1.0 5 │ Fz 0.51 90.0 0.0 0.72 0.7 1.0 ⋯ 6 │ F4 0.65 51.0 0.55 0.67 0.5 1.0 7 │ F8 1.0 36.0 0.81 0.59 -0.03 1.0 8 │ T3 1.0 180.0 -1.0 0.0 -0.03 1.0 9 │ C3 0.51 180.0 -0.72 0.0 0.7 1.0 ⋯ 10 │ Cz 0.0 0.0 0.0 0.0 1.0 1.0 11 │ C4 0.51 0.0 0.72 0.0 0.7 1.0 ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ 14 │ P3 0.65 231.0 -0.55 -0.67 0.5 1.0 15 │ Pz 0.51 270.0 0.0 -0.72 0.7 1.0 ⋯ 16 │ P4 0.65 309.0 0.55 -0.67 0.5 1.0 17 │ T6 1.0 324.0 0.81 -0.59 -0.03 1.0 18 │ O1 1.0 252.0 -0.31 -0.95 -0.03 1.0 19 │ O2 1.0 288.0 0.31 -0.95 -0.03 1.0 ⋯ 20 │ A1 1.0 192.0 -0.92 -0.23 -0.55 1.1 21 │ A2 1.0 -12.0 0.92 -0.23 -0.55 1.1 22 │ EOG1 1.01 149.0 -0.87 0.51 -0.37 1.0 23 │ EOG2 1.01 31.0 0.87 0.51 -0.37 1.0 ⋯ 3 columns and 2 rows omitted, ["reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=iirnotch, ftype=nothing, cutoff=50, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=fir, ftype=hp, cutoff=0.1, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "reset_components(OBJ)", "reference_ce(OBJ, ch=[1, 2], med=false)"])
Reference to common average (CAR):
reference_avg(eeg, exclude_fpo=true, exclude_current=true)
NeuroAnalyzer.NEURO(NeuroAnalyzer.HEADER(Dict{Symbol, Any}(:weight => -1, :id => "", :middle_name => "", :height => -1, :head_circumference => -1, :handedness => "", :last_name => "528004 SIT 52, 20220831-122227-{d589f756-53fc-4f1b-915d-6e3b8c1560ad}", :first_name => ""), Dict{Symbol, Any}(:epoch_id => "", :channel_type => ["eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg" … "eeg", "eeg", "ref", "ref", "eeg", "eeg", "eeg", "eog", "eog", "ecg"], :label => ["Fp1-avg", "Fp2-avg", "F3-avg", "F4-avg", "C3-avg", "C4-avg", "P3-avg", "P4-avg", "O1-avg", "O2-avg" … "T5-avg", "T6-avg", "A1", "A2", "Fz-avg", "Cz-avg", "Pz-avg", "EOG1", "EOG2", "ECG"], :prefiltering => ["HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz" … "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz"], :gain => [0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218 … 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218], :data_type => "eeg", :recording_notes => "", :recording_date => "31.08.22", :sampling_rate => 256, :file_type => "EDF"…), Dict(:name => "", :design => "", :notes => "")), [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [-0.005740583280837763 -7.5893713567412675 … -1.8544148477784974 0.0001318699392344636; 0.04782152834088155 -160.0533519747603 … 4.018744592373704 -0.0001105848632394046; … ; -0.022184604323419066 127.03733086748798 … -0.6385598239986807 0.0008236881401195717; -0.055585528301492104 530.00037195304 … -8.80813398237423 0.0018241535887852933;;;], Dict{Any, Any}(), 0×5 DataFrame Row │ id start length description channel │ String Float64 Float64 String Int64 ─────┴────────────────────────────────────────────────, 23×9 DataFrame Row │ label loc_radius loc_theta loc_x loc_y loc_z loc_radius_sp ⋯ │ String Float64 Float64 Float64 Float64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── 1 │ Fp1 1.0 108.0 -0.31 0.95 -0.03 1.0 ⋯ 2 │ Fp2 1.0 72.0 0.31 0.95 -0.03 1.0 3 │ F7 1.0 144.0 -0.81 0.59 -0.03 1.0 4 │ F3 0.65 129.0 -0.55 0.67 0.5 1.0 5 │ Fz 0.51 90.0 0.0 0.72 0.7 1.0 ⋯ 6 │ F4 0.65 51.0 0.55 0.67 0.5 1.0 7 │ F8 1.0 36.0 0.81 0.59 -0.03 1.0 8 │ T3 1.0 180.0 -1.0 0.0 -0.03 1.0 9 │ C3 0.51 180.0 -0.72 0.0 0.7 1.0 ⋯ 10 │ Cz 0.0 0.0 0.0 0.0 1.0 1.0 11 │ C4 0.51 0.0 0.72 0.0 0.7 1.0 ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ 14 │ P3 0.65 231.0 -0.55 -0.67 0.5 1.0 15 │ Pz 0.51 270.0 0.0 -0.72 0.7 1.0 ⋯ 16 │ P4 0.65 309.0 0.55 -0.67 0.5 1.0 17 │ T6 1.0 324.0 0.81 -0.59 -0.03 1.0 18 │ O1 1.0 252.0 -0.31 -0.95 -0.03 1.0 19 │ O2 1.0 288.0 0.31 -0.95 -0.03 1.0 ⋯ 20 │ A1 1.0 192.0 -0.92 -0.23 -0.55 1.1 21 │ A2 1.0 -12.0 0.92 -0.23 -0.55 1.1 22 │ EOG1 1.01 149.0 -0.87 0.51 -0.37 1.0 23 │ EOG2 1.01 31.0 0.87 0.51 -0.37 1.0 ⋯ 3 columns and 2 rows omitted, ["reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=iirnotch, ftype=nothing, cutoff=50, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=fir, ftype=hp, cutoff=0.1, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "reset_components(OBJ)", "reference_avg(OBJ, exclude_fpo=true, exclude_current=true, average=true, med=false, weighted=false)"])
(!) exclude_fpo=true
will exclude Fp1, Fp2 (due to eye blinks), O1, O2 (due to head movements) from CAR calculation.
(!) exclude_current=true
will exclude current channel from CAR calculation.
Reference to ipsilateral auricular electrodes:
reference_a(eeg, type=:i)
NeuroAnalyzer.NEURO(NeuroAnalyzer.HEADER(Dict{Symbol, Any}(:weight => -1, :id => "", :middle_name => "", :height => -1, :head_circumference => -1, :handedness => "", :last_name => "528004 SIT 52, 20220831-122227-{d589f756-53fc-4f1b-915d-6e3b8c1560ad}", :first_name => ""), Dict{Symbol, Any}(:epoch_id => "", :channel_type => ["eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg" … "eeg", "eeg", "ref", "ref", "eeg", "eeg", "eeg", "eog", "eog", "ecg"], :label => ["Fp1-A1", "Fp2-A2", "F3-A1", "F4-A2", "C3-A1", "C4-A2", "P3-A1", "P4-A2", "O1-A1", "O2-A2" … "T5-A1", "T6-A2", "A1", "A2", "Fz-A1A2", "Cz-A1A2", "Pz-A1A2", "EOG1", "EOG2", "ECG"], :prefiltering => ["HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz" … "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz"], :gain => [0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218 … 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218], :data_type => "eeg", :recording_notes => "", :recording_date => "31.08.22", :sampling_rate => 256, :file_type => "EDF"…), Dict(:name => "", :design => "", :notes => "")), [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [0.10067784609364594 -434.30449874549333 … 1.0047433758524527 -0.0010433394978917043; 0.13906138679463176 -275.468525299403 … 4.602919635132624 -0.0004690368236789366; … ; -0.022184604323419066 127.03733086748798 … -0.6385598239986807 0.0008236881401195717; -0.055585528301492104 530.00037195304 … -8.80813398237423 0.0018241535887852933;;;], Dict{Any, Any}(), 0×5 DataFrame Row │ id start length description channel │ String Float64 Float64 String Int64 ─────┴────────────────────────────────────────────────, 23×9 DataFrame Row │ label loc_radius loc_theta loc_x loc_y loc_z loc_radius_sp ⋯ │ String Float64 Float64 Float64 Float64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── 1 │ Fp1 1.0 108.0 -0.31 0.95 -0.03 1.0 ⋯ 2 │ Fp2 1.0 72.0 0.31 0.95 -0.03 1.0 3 │ F7 1.0 144.0 -0.81 0.59 -0.03 1.0 4 │ F3 0.65 129.0 -0.55 0.67 0.5 1.0 5 │ Fz 0.51 90.0 0.0 0.72 0.7 1.0 ⋯ 6 │ F4 0.65 51.0 0.55 0.67 0.5 1.0 7 │ F8 1.0 36.0 0.81 0.59 -0.03 1.0 8 │ T3 1.0 180.0 -1.0 0.0 -0.03 1.0 9 │ C3 0.51 180.0 -0.72 0.0 0.7 1.0 ⋯ 10 │ Cz 0.0 0.0 0.0 0.0 1.0 1.0 11 │ C4 0.51 0.0 0.72 0.0 0.7 1.0 ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ 14 │ P3 0.65 231.0 -0.55 -0.67 0.5 1.0 15 │ Pz 0.51 270.0 0.0 -0.72 0.7 1.0 ⋯ 16 │ P4 0.65 309.0 0.55 -0.67 0.5 1.0 17 │ T6 1.0 324.0 0.81 -0.59 -0.03 1.0 18 │ O1 1.0 252.0 -0.31 -0.95 -0.03 1.0 19 │ O2 1.0 288.0 0.31 -0.95 -0.03 1.0 ⋯ 20 │ A1 1.0 192.0 -0.92 -0.23 -0.55 1.1 21 │ A2 1.0 -12.0 0.92 -0.23 -0.55 1.1 22 │ EOG1 1.01 149.0 -0.87 0.51 -0.37 1.0 23 │ EOG2 1.01 31.0 0.87 0.51 -0.37 1.0 ⋯ 3 columns and 2 rows omitted, ["reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=iirnotch, ftype=nothing, cutoff=50, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=fir, ftype=hp, cutoff=0.1, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "reset_components(OBJ)", "reference_a(OBJ, type=i, med=false)"])
Reference to contralateral mastoid electrodes:
# we don't have mastoid channels, so let's pretend
edit_channel!(eeg, ch="A1", field=:label, value="M1")
edit_channel!(eeg, ch="A2", field=:label, value="M2")
reference_m(eeg, type=:c)
NeuroAnalyzer.NEURO(NeuroAnalyzer.HEADER(Dict{Symbol, Any}(:weight => -1, :id => "", :middle_name => "", :height => -1, :head_circumference => -1, :handedness => "", :last_name => "528004 SIT 52, 20220831-122227-{d589f756-53fc-4f1b-915d-6e3b8c1560ad}", :first_name => ""), Dict{Symbol, Any}(:epoch_id => "", :channel_type => ["eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg", "eeg" … "eeg", "eeg", "ref", "ref", "eeg", "eeg", "eeg", "eog", "eog", "ecg"], :label => ["Fp1-M2", "Fp2-M1", "F3-M2", "F4-M1", "C3-M2", "C4-M1", "P3-M2", "P4-M1", "O1-M2", "O2-M1" … "T5-M2", "T6-M1", "M1", "M2", "Fz-M1M2", "Cz-M1M2", "Pz-M1M2", "EOG1", "EOG2", "ECG"], :prefiltering => ["HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz" … "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz", "HP:0,18Hz LP:104,0Hz"], :gain => [0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218 … 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218, 0.17935713740749218], :data_type => "eeg", :recording_notes => "", :recording_date => "31.08.22", :sampling_rate => 256, :file_type => "EDF"…), Dict(:name => "", :design => "", :notes => "")), [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [0.0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.023, 0.027, 0.031, 0.035 … 1204.961, 1204.965, 1204.969, 1204.973, 1204.977, 1204.98, 1204.984, 1204.988, 1204.992, 1204.996], [0.08549927517291245 -123.00454468138393 … -1.2702398050195773 -0.00022658202120506843; 0.15423995771536525 -586.7684793635124 … 6.877902816004653 -0.0012857943003655725; … ; -0.022184604323419066 127.03733086748798 … -0.6385598239986807 0.0008236881401195717; -0.055585528301492104 530.00037195304 … -8.80813398237423 0.0018241535887852933;;;], Dict{Any, Any}(), 0×5 DataFrame Row │ id start length description channel │ String Float64 Float64 String Int64 ─────┴────────────────────────────────────────────────, 23×9 DataFrame Row │ label loc_radius loc_theta loc_x loc_y loc_z loc_radius_sp ⋯ │ String Float64 Float64 Float64 Float64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── 1 │ Fp1 1.0 108.0 -0.31 0.95 -0.03 1.0 ⋯ 2 │ Fp2 1.0 72.0 0.31 0.95 -0.03 1.0 3 │ F7 1.0 144.0 -0.81 0.59 -0.03 1.0 4 │ F3 0.65 129.0 -0.55 0.67 0.5 1.0 5 │ Fz 0.51 90.0 0.0 0.72 0.7 1.0 ⋯ 6 │ F4 0.65 51.0 0.55 0.67 0.5 1.0 7 │ F8 1.0 36.0 0.81 0.59 -0.03 1.0 8 │ T3 1.0 180.0 -1.0 0.0 -0.03 1.0 9 │ C3 0.51 180.0 -0.72 0.0 0.7 1.0 ⋯ 10 │ Cz 0.0 0.0 0.0 0.0 1.0 1.0 11 │ C4 0.51 0.0 0.72 0.0 0.7 1.0 ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ 14 │ P3 0.65 231.0 -0.55 -0.67 0.5 1.0 15 │ Pz 0.51 270.0 0.0 -0.72 0.7 1.0 ⋯ 16 │ P4 0.65 309.0 0.55 -0.67 0.5 1.0 17 │ T6 1.0 324.0 0.81 -0.59 -0.03 1.0 18 │ O1 1.0 252.0 -0.31 -0.95 -0.03 1.0 19 │ O2 1.0 288.0 0.31 -0.95 -0.03 1.0 ⋯ 20 │ A1 1.0 192.0 -0.92 -0.23 -0.55 1.1 21 │ A2 1.0 -12.0 0.92 -0.23 -0.55 1.1 22 │ EOG1 1.01 149.0 -0.87 0.51 -0.37 1.0 23 │ EOG2 1.01 31.0 0.87 0.51 -0.37 1.0 ⋯ 3 columns and 2 rows omitted, ["reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=iirnotch, ftype=nothing, cutoff=50, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "reset_components(OBJ)", "filter(OBJ, ch=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], fprototype=fir, ftype=hp, cutoff=0.1, order=8, rp=-1, rs=-1, dir=twopass, w=nothing)", "edit_channel(OBJ, ch=17, field=label, value=M1)", "edit_channel(OBJ, ch=18, field=label, value=M2)", "reset_components(OBJ)", "reference_m(OBJ, type=c, med=false)"])
Reference using planar Laplacian:
= reference_avg(eeg)
eeg_avg :label] = replace.(eeg_avg.header.recording[:label], "-avg"=>"")
eeg_avg.header.recording[= plot_topo(eeg_avg, ch="eeg", seg=(12, 14), title="AVG",)
p1 = reference_avg(eeg, weighted=true)
eeg_wavg :label] = replace.(eeg_avg.header.recording[:label], "-wavg"=>"")
eeg_wavg.header.recording[= plot_topo(eeg_avg, ch="eeg", seg=(12, 14), title="WAVG",)
p2 = reference_plap(eeg, nn=4, weighted=false)
eeg_lap :label] = replace.(eeg_lap.header.recording[:label], "-plap"=>"")
eeg_lap.header.recording[= plot_topo(eeg_lap, ch="eeg", seg=(12, 14), title="Laplacian (4)")
p3 = reference_plap(eeg, nn=4, weighted=true)
eeg_lap :label] = replace.(eeg_lap.header.recording[:label], "-wplap"=>"")
eeg_lap.header.recording[= plot_topo(eeg_lap, ch="eeg", seg=(12, 14), title="weighted Laplacian (4)")
p4 plot(p1, p2, p3, p4, layout=(2,2)) Plots.
(!) 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
m[ Info: Bad channels matrix will be reset
(!) ref_list
must contain the list of channel pairs.
info(eeg_bipl)
Data type: EEG
File format: EDF
Source file: /home/eb/Documents/Data/eeg.hdf
File size [MB]: 62685.32
Memory size [MB]: 112.98
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: 23
Epochs ID:
Number of epochs: 1
Epoch length [samples]: 308480
Epoch length [seconds]: 1205.0
Reference type: longitudinal-BIP
Line frequency: 50 Hz
Markers: no
Channel locations: yes
Components: no
Number of EEG channels: 18
Channels:
ch label type unit bad
------ --------------- ----------- ------- -------
1 Fz-Cz EEG μV 0.0
2 Cz-Pz EEG μV 0.0
3 Fp1-F7 EEG μV 0.0
4 Fp1-F3 EEG μV 0.0
5 F7-T3 EEG μV 0.0
6 T3-T5 EEG μV 0.0
7 T5-O1 EEG μV 0.0
8 F3-C3 EEG μV 0.0
9 C3-P3 EEG μV 0.0
10 P3-O1 EEG μV 0.0
11 Fp2-F8 EEG μV 0.0
12 Fp2-F4 EEG μV 0.0
13 F8-T4 EEG μV 0.0
14 T4-T6 EEG μV 0.0
15 T6-O2 EEG μV 0.0
16 F4-C4 EEG μV 0.0
17 C4-P4 EEG μV 0.0
18 P4-O2 EEG μV 0.0
19 M1 REF μV 0.0
20 M2 REF μV 0.0
21 EOG1 EOG μV 0.0
22 EOG2 EOG μV 0.0
23 ECG ECG mV 0.0
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"]
ref_list = "transverse-BIP" ref_name
"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"]
ref_list = "longitudinal-BIP" ref_name
"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"]
ref_list = "longitudinal-BIP" ref_name
"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_list=ref_l, ref_name=ref_n); eeg_custom
m[ Info: Bad channels matrix will be reset
info(eeg_custom)
Data type: EEG
File format: EDF
Source file: /home/eb/Documents/Data/eeg.hdf
File size [MB]: 62685.32
Memory size [MB]: 112.98
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: 23
Epochs ID:
Number of epochs: 1
Epoch length [samples]: 308480
Epoch length [seconds]: 1205.0
Reference type: longitudinal-BIP
Line frequency: 50 Hz
Markers: no
Channel locations: yes
Components: no
Number of EEG channels: 18
Channels:
ch label type unit bad
------ --------------- ----------- ------- -------
1 Fz-Cz EEG μV 0.0
2 Cz-Pz EEG μV 0.0
3 Fp1-F7 EEG μV 0.0
4 Fp1-F3 EEG μV 0.0
5 F7-T3 EEG μV 0.0
6 T3-T5 EEG μV 0.0
7 T5-O1 EEG μV 0.0
8 F3-C3 EEG μV 0.0
9 C3-P3 EEG μV 0.0
10 P3-O1 EEG μV 0.0
11 Fp2-F8 EEG μV 0.0
12 Fp2-F4 EEG μV 0.0
13 F8-T4 EEG μV 0.0
14 T4-T6 EEG μV 0.0
15 T6-O2 EEG μV 0.0
16 F4-C4 EEG μV 0.0
17 C4-P4 EEG μV 0.0
18 P4-O2 EEG μV 0.0
19 M1 REF μV 0.0
20 M2 REF μV 0.0
21 EOG1 EOG μV 0.0
22 EOG2 EOG μV 0.0
23 ECG ECG mV 0.0
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.