NeuroAnalyzer tutorials: Edit EEG (2)

Edit channels

Show labels:

labels(edf)

Get channel by number:

get_channel(eeg, 18)

Rename channels:

rename_channel!(eeg, ch="Cz", name="CZ")

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

delete_channel!(eeg, ch="Cz")
delete_channel!(eeg, ch=get_channel(eeg, type="eeg")[10:18])

Keep channel:

keep_channel!(eeg, ch=get_channel(eeg, type="eeg")[1:4])

Replace channel 1 with channel 18:

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

Epoching

(!) 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 decomposition).

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)
erp!(e5avg)
info(e5avg)

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)

Create sub-epochs (of reduced time range, start at 0.1 sec and end 1.1 sec):

subepoch!(erp, ep_start=0.1, ep_end=1.1)

Edit epochs

Get 1st epoch:

e10e1 = extract_epoch(e10, ep=1)
info(e10e1)

Delete epochs:

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

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

Keep epochs:

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

Using markers

View markers:

view_marker(eeg)

(!) 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")