NeuroAnalyzer tutorials: Topographical maps

Load data:

using NeuroAnalyzer
using Plots
eeg = load("files/eeg.hdf");
[ Info: Precompiling NeuroAnalyzer [b40dcafa-b65c-47ad-a230-3174ba5cadd1] (cache misses: include_dependency fsize change (2), wrong dep version loaded (2), incompatible header (4), mismatched flags (10))
[ Info: NeuroAnalyzer v0.25.5-dev
[ Info: NeuroAnalyzer path: /home/eb/Documents/Code/NeuroAnalyzer.jl
[ Info:  Preferences:
[ Info:     Use CUDA: false
[ Info: Progress bar: true
[ Info:      Verbose: true
[ Info: Exclude bads: false
[ Info: Preparing resources
[ Info: Loading plugins:
[ Info:  Loaded: na_test_plugin.jl
[ Info:  Loaded: plot_env.jl
[ Info:  Loaded: plot_ispc.jl
[ Info:  Loaded: plot_itpc.jl
[ Info:  Loaded: plot_pli.jl
[ Info: Loaded: EEG (24 × 282991 × 1; 1105.43 s)

Plot topomap:

plot_topo(eeg, ch="eeg")

To generate a small topomap:

plot_topo(eeg, ch="eeg", large=false)

Several interpolation methods are available:

  • :sh: Shepard – default
  • :mq: Multiquadratic
  • :imq: Inverse Multiquadratic
  • :tp: ThinPlate
  • :nn: NearestNeighbour
  • :ga: Gaussian
plot_topo(eeg, ch="eeg", imethod=:sh, title="Shepard")
plot_topo(eeg, ch="eeg", imethod=:mq, title="Multiquadratic")
plot_topo(eeg, ch="eeg", imethod=:imq, title="Inverse Multiquadratic")
plot_topo(eeg, ch="eeg", imethod=:tp, title="ThinPlate")
plot_topo(eeg, ch="eeg", imethod=:nn, title="NearestNeighbour")
plot_topo(eeg, ch="eeg", imethod=:ga, title="Gaussian")

All plots show topomap of the signal averaged over time window 0:10 s.

Plot weights

Default threshold type is :neq (not equal):

plot_locs(eeg, ch="eeg", weights=rand(-1:0.1:1, 19), threshold=0.5)

Plot connections

Draw connections that have value > 0.95:

plot_locs(eeg, ch="eeg", connections=rand(19, 19), threshold_type=:g, threshold=0.95)

Connectivity circle

Connections can also be visualized using connectivity circle:

l = get_channel(eeg, type="eeg")
# we use fake connectivity matrix here
m = rand(-10:0.1:10, length(l), length(l))
p = plot_connectivity_circle(m, clabels=l, threshold_type=:geq, threshold=2)

(!) Only the upper triangular part of the connectivity matrix is used. Normally it should be symmetrical. If not (in the case of bidirectional data), consider drawing two plots, one for the upper triangle and another for the transposed matrix (m').

(!) Positive values are drawn in red, negative values in blue.

(!) Relative connections widths represent connections values.

p = plot_connectivity_circle(m, clabels=l, threshold_type=:leq, threshold=-2)