NeuroAnalyzer tutorials: Edit EEG (2)

Edit channels

Show labels:


Get channel (by name or number):

get_channel(eeg, channel="Cz")
get_channel(eeg, channel=18)

Rename channels:

rename_channel!(eeg, channel=18, name="Cz")

Delete channels (epochs and channels may be specified using number, range or vector):

delete_channel!(eeg, channel=1)
delete_channel!(eeg, channel=10:18)
delete_channel!(eeg, channel=[1, 5, 9])
delete_channel!(eeg, channel=[1:5; 9; 10])

(!) Note the use of ; if range is specified.

Keep channel:

keep_channel!(eeg, channel=1:4)

Replace channel 1 with channel 18:

ch18 = extract_channel(eeg, channel=18)
replace_channel!(eeg, channel=1, signal=ch18)


Split EEG into 10-second epochs:

e10 = epoch(eeg, ep_len=10)

Split into 5-second epochs and then average into one epoch:

e5avg = epoch(eeg, ep_len=5)

Split into epochs at the event marker (each epoch is 1500 ms long and starts 200 ms before the event marker):

erp = epoch(eeg, marker="stimulus", offset=0.2, ep_len=1.5)

(!) Many processing operations (such as filtering or ICA decomposition) should be performed on non-epoched (continuous) signal (e.g. due to the edge artifacts that may occur in case of filtering or the minimum required signal length for ICA decompositon).

Edit epochs

Get 1st epoch:

e10e1 = extract_epoch(e10, epoch=1)

Delete epochs:

delete_epoch!(e10, epoch=1)
delete_epoch!(e10, epoch=8:10)
delete_epoch!(e10, epoch=[1:5; 9; 10])

(!) Note the use of ; if range is specified.

Keep epochs:

keep_epoch!(e10, epoch=[1, 3, 5, 9])

Using markers

View markers:


(!) Value of channel refers to channels affected by the marker; 0 means all channels; values other than 0 are not supported.

Delete 1st marker:

delete_marker!(eeg, n=1)

Edit 1st marker:

edit_marker!(eeg, n=1, id="Note", start=1, len=1, desc="test")

Add marker at position start (in seconds):

add_marker!(eeg, id="Note", start=1, len=1, desc="test")