NeuroAnalyzer tutorials: Interactive preview and edit

Initialize NeuroAnalyzer
using NeuroAnalyzer;

For interactive plots, Gtk4 and Cairo are required (all necessary libraries should be installed automatically).

Viewing

iview() is a multi-tool for viewing and editing continuous and epoched signals:

iview(eeg)
iview(eeg, zoom=20) # show signal in 20-second fragments

(!) Default zoom value is 10 seconds.

(!) Ctrl + mouse wheel scrolls channels up and down.

(!) Shift + mouse wheel scrolls the signal by one second.

(!) Alt + mouse wheel scrolls the signal by one segment (default is 10 seconds).

(!) Left click on the channel label shows its details.

(!) Right click on the channel label marks the channel as bad.

(!) Right click on the - button to go to the signal start.

(!) Right click on the + button to go to the signal end.

Keyboard shortcuts:

  • Ctrl + b: toggle butterfly plot
  • Ctrl + m: toggle mean plot
  • Home: go to the signal start
  • End: go to the signal end
  • Ctrl + ,: go back by 1 seconds
  • Ctrl + .: go forward by 1 seconds
  • Alt + ,: go back by zoom seconds
  • Alt + .: go forward by zoom seconds
  • Ctrl + z: scroll channels up
  • Ctrl + x: scroll channels down
  • Alt + m: toggle monochromatic mode
  • Alt + s: toggle scales
  • [: zoom in
  • ]: zoom out
  • Ctrl + h: show keyboard shortcuts
  • Ctrl + q: close

If a scrollbar (either time or channels) is selected, pressing Home or End moves the scrollbar to its start or end, respectively.

Butterfly plot:

Mean plot:

(!) Epoched signal can be viewed (by epochs) using iview_ep().

For epoched signal the controls are as listed above. Zoom level cannot be changed and is always set to the epoch length.

To view one channel at a time, use: iview(eeg, mch=false)

Editing

While viewing, parts of the signal may be deleted using two markers.

(!) Epoched signal should be edited using iview_ep(), while continuous signal should be edited using iview().

(!) Place the first marker by clicking with the left mouse button and the second marker with the right mouse button or use time segment entry boxes.

Keyboard shortcuts:

  • Ctrl + Enter: return current time segment
  • Ctrl + d: delete time segment
  • Ctrl + s: toggle snapping

(!) By default markers are snapped to time points at the closest quarter (0.25, 0.5, 0.75 or 1.0) of a second; to turn it off, use snap=false option or press Ctrl + s while editing.

To edit the epoched signal interactively:

iview_ep(eeg)

Keyboard shortcuts:

  • Ctrl + d: delete current epoch

Comparing signals

To compare two signals, e.g. before and after filtering:

eeg1 = NeuroAnalyzer.filter(e10, ch="eeg", fprototype=:butterworth, ftype=:bp, cutoff=(4, 8), order=8)
eeg2 = NeuroAnalyzer.filter(e10, ch="eeg", fprototype=:butterworth, ftype=:bp, cutoff=(8, 12), order=8)
iview(eeg1, eeg2)

Viewing components

iview() can also be used to preview embedded or external components:

iview(eeg, ic)

Viewing plots

Each plot object may be opened using an interactive viewer:

p = NeuroAnalyzer.plot(eeg, ch=["Fp1", "Fp2", "F3", "F4"], seg=(30, 40))
iview(p)

Available shortcuts:

  • Ctrl + s: save as PNG file
  • Ctrl + q: close

iview() may also be used to open PNG files:

iview("example.png")

ipsd()

PSD may be plotted using interactive plot:

ipsd(eeg, ch="eeg")

Keyboard shortcuts:

  • Ctrl + ,: go back by 1 seconds
  • Ctrl + .: go forward by 1 seconds
  • Alt + ,: go back by zoom seconds
  • Alt + .: go forward by zoom seconds
  • [: zoom in
  • ]: zoom out
  • Ctrl + s: save as PNG
  • Ctrl + h: show keyboard shortcuts
  • Ctrl + q: close

For epoched signal:

ipsd_ep(e10, ch="eeg")

Keyboard shortcuts:

  • Ctrl + ,: previous epoch
  • Ctrl + .: next epoch
  • Ctrl + s: save as PNG
  • Ctrl + h: show keyboard shortcuts
  • Ctrl + q: close

(!) Zoom does not work for ipsd_ep().

For continuous wavelet transformation, custom wavelet formula may be entered in the field (default is Morlet(2π), β=32, Q=128). Please refer to the documentation of ContinuousWavelets.jl to see the list of available wavelet families and parameters.

(!) Shift + mouse wheel scrolls the signal by one second.

(!) Alt + mouse wheel scrolls the signal by one segment (default is 10 seconds).

ispectrogram()

Spectrogram may be plotted using interactive plot:

ispectrogram(eeg, ch="eeg")

Keyboard shortcuts:

  • Ctrl + ,: go back by 1 seconds
  • Ctrl + .: go forward by 1 seconds
  • Alt + ,: go back by zoom seconds
  • Alt + .: go forward by zoom seconds
  • [: zoom in
  • ]: zoom out
  • Ctrl + s: save as PNG
  • Ctrl + h: show keyboard shortcuts
  • Ctrl + q: close

For epoched signal:

ispectrogram_ep(e10, ch="Fp1")

Keyboard shortcuts:

  • Ctrl + ,: previous epoch
  • Ctrl + .: next epoch
  • Ctrl + s: save as PNG
  • Ctrl + h: show keyboard shortcuts
  • Ctrl + q: close

(!) Zoom does not work for ispectrogram_ep().

For continuous wavelet transformation, custom wavelet formula may be entered in the field (default is Morlet(2π), β=32, Q=128). Please refer to the documentation of DSP.jl to see the list of available wavelet families and parameters.

(!) Shift + mouse wheel scrolls the signal by one second.

(!) Alt + mouse wheel scrolls the signal by one segment (default is 10 seconds).

itopo()

To preview interactively topographical plots, use:

itopo(eeg, ch="eeg")

Available shortcuts:

Keyboard shortcuts:

  • Ctrl + s: save as PNG
  • Ctrl + h: show keyboard shortcuts
  • Ctrl + q: close

(!) Segment defines time in seconds.

Epoched signal:

itopo_ep(e10, ch="eeg")

MEG (draw magnetometers):

itopo(meg, ch="mag")